forked from perkeep/perkeep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev-camget
executable file
·47 lines (38 loc) · 1.09 KB
/
dev-camget
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
use strict;
use FindBin qw($Bin);
use Getopt::Long;
require "$Bin/misc/devlib.pl";
sub usage {
die "Usage: dev-camget [--tls] -- camget_args";
}
my $opt_tls;
my $opt_path = "/bs";
Getopt::Long::Configure("pass_through");
GetOptions(
"tls" => \$opt_tls,
"path=s" => \$opt_path,
) or usage();
my $camget = build_bin("./cmd/camget");
# Respected by camli/osutil:
$ENV{"CAMLI_CONFIG_DIR"} = "$Bin/config/dev-client-dir";
# Respected by env expansions in config/dev-client-dir/config
$ENV{"CAMLI_SECRET_RING"} = "$Bin/pkg/jsonsign/testdata/test-secring.gpg";
$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${opt_path}";
if ($opt_tls) {
$blobserver =~ s/^http/https/;
}
my @args;
unless (grep { /^--?shared\b/ } @ARGV) {
push @args, "--server=$blobserver";
}
push @args, @ARGV;
my $verbose = "true";
$verbose = "false" if $ENV{CAMLI_QUIET};
exec("$camget",
"--verbose=$verbose",
@args);
die "Failure running camget: $!";