2011-05-16 04:54:57 +00:00
|
|
|
#!/usr/bin/perl
|
2011-01-01 22:44:19 +00:00
|
|
|
|
2011-05-16 04:54:57 +00:00
|
|
|
use strict;
|
|
|
|
use FindBin qw($Bin);
|
2011-11-16 10:41:38 +00:00
|
|
|
use Getopt::Long;
|
2011-05-16 04:54:57 +00:00
|
|
|
|
2012-03-05 15:42:46 +00:00
|
|
|
unless ($ENV{GOPATH}) {
|
|
|
|
$ENV{GOPATH} = "$Bin/gopath"
|
|
|
|
}
|
|
|
|
|
|
|
|
system("go", "install", "camlistore.org/cmd/camput") and die "failed to build camput";
|
2011-05-16 04:54:57 +00:00
|
|
|
|
2011-11-16 10:41:38 +00:00
|
|
|
sub usage {
|
|
|
|
die "Usage: dev-camput [--tls] -- camput_args";
|
|
|
|
}
|
|
|
|
|
|
|
|
my $opt_tls;
|
2011-12-06 05:02:44 +00:00
|
|
|
Getopt::Long::Configure("pass_through");
|
2011-11-16 10:41:38 +00:00
|
|
|
GetOptions("tls" => \$opt_tls)
|
|
|
|
or usage();
|
|
|
|
|
2011-05-30 19:38:26 +00:00
|
|
|
# Respected by camli/osutil:
|
2011-05-16 04:54:57 +00:00
|
|
|
$ENV{"CAMLI_CONFIG_DIR"} = "$Bin/config/dev-client-dir";
|
2011-05-30 19:38:26 +00:00
|
|
|
|
|
|
|
# Respected by env expansions in config/dev-client-dir/config
|
|
|
|
$ENV{"CAMLI_SECRET_RING"} = "$Bin/lib/go/camli/jsonsign/testdata/test-secring.gpg";
|
2011-06-02 23:57:49 +00:00
|
|
|
$ENV{"CAMLI_KEYID"} = "26F5ABDA";
|
2011-05-30 19:38:26 +00:00
|
|
|
$ENV{"CAMLI_DEV_KEYBLOBS"} = "$Bin/config/dev-client-dir/keyblobs";
|
2012-03-05 15:42:46 +00:00
|
|
|
$ENV{"CAMLI_AUTH"} = "userpass:camlistore:pass3179";
|
2011-11-16 10:41:38 +00:00
|
|
|
my $blobserver = "http://localhost:3179/bs";
|
|
|
|
if ($opt_tls) {
|
|
|
|
$blobserver =~ s/^http/https/;
|
|
|
|
}
|
2011-05-30 19:38:26 +00:00
|
|
|
|
2012-03-05 15:42:46 +00:00
|
|
|
exec("$ENV{GOPATH}/bin/camput",
|
2011-09-21 01:29:10 +00:00
|
|
|
"--verbose",
|
2011-11-16 10:41:38 +00:00
|
|
|
"--blobserver=$blobserver",
|
2011-09-21 01:29:10 +00:00
|
|
|
@ARGV);
|
2012-03-05 15:42:46 +00:00
|
|
|
die "Failure running camput: $!";
|