2011-12-06 14:26:19 +00:00
|
|
|
#!/usr/bin/perl
|
2011-01-02 22:36:03 +00:00
|
|
|
|
2011-12-06 14:26:19 +00:00
|
|
|
use strict;
|
|
|
|
use FindBin qw($Bin);
|
|
|
|
use Getopt::Long;
|
2012-03-27 17:37:21 +00:00
|
|
|
require "$Bin/misc/devlib.pl";
|
2011-12-06 14:26:19 +00:00
|
|
|
|
2012-03-05 16:04:42 +00:00
|
|
|
unless ($ENV{GOPATH}) {
|
|
|
|
$ENV{GOPATH} = "$Bin/gopath"
|
|
|
|
}
|
|
|
|
|
|
|
|
system("go", "install", "camlistore.org/cmd/camget") and die "failed to build camget";
|
2011-12-06 14:26:19 +00:00
|
|
|
|
|
|
|
sub usage {
|
|
|
|
die "Usage: dev-camget [--tls] -- camget_args";
|
|
|
|
}
|
|
|
|
|
|
|
|
my $opt_tls;
|
2011-12-06 16:45:28 +00:00
|
|
|
Getopt::Long::Configure("pass_through");
|
2011-12-06 14:26:19 +00:00
|
|
|
GetOptions("tls" => \$opt_tls)
|
|
|
|
or usage();
|
|
|
|
|
2012-03-27 17:37:21 +00:00
|
|
|
my $camget = build_bin("./cmd/camget");
|
|
|
|
|
2011-12-06 14:26:19 +00:00
|
|
|
# Respected by camli/osutil:
|
|
|
|
$ENV{"CAMLI_CONFIG_DIR"} = "$Bin/config/dev-client-dir";
|
|
|
|
|
|
|
|
# Respected by env expansions in config/dev-client-dir/config
|
2012-05-13 15:07:04 +00:00
|
|
|
$ENV{"CAMLI_SECRET_RING"} = "$Bin/pkg/jsonsign/testdata/test-secring.gpg";
|
2011-12-06 14:26:19 +00:00
|
|
|
$ENV{"CAMLI_KEYID"} = "26F5ABDA";
|
|
|
|
$ENV{"CAMLI_DEV_KEYBLOBS"} = "$Bin/config/dev-client-dir/keyblobs";
|
|
|
|
$ENV{CAMLI_AUTH} = "userpass:camlistore:pass3179";
|
|
|
|
my $blobserver = "http://localhost:3179/bs";
|
|
|
|
if ($opt_tls) {
|
|
|
|
$blobserver =~ s/^http/https/;
|
|
|
|
}
|
|
|
|
|
2013-01-03 04:46:49 +00:00
|
|
|
my @args;
|
|
|
|
unless (grep { /^--?shared\b/ } @ARGV) {
|
2013-01-26 00:23:31 +00:00
|
|
|
push @args, "--server=$blobserver";
|
2013-01-03 04:46:49 +00:00
|
|
|
}
|
|
|
|
push @args, @ARGV;
|
|
|
|
|
2012-03-27 17:37:21 +00:00
|
|
|
exec("$camget",
|
2011-12-06 14:26:19 +00:00
|
|
|
"--verbose",
|
2013-01-03 04:46:49 +00:00
|
|
|
@args);
|
2012-03-05 16:04:42 +00:00
|
|
|
die "Failure running camget: $!";
|