our $action = shift @ARGV // die "need ACTION";
our $publicmode = 02775;
-our $new_upload_propagation_slop = 3600*4 + 100;
+our $new_upload_propagation_slop = 3600*4 + 100;# fixme config;
our $poldbh;
our $pkg;
sub apiquery ($) {
my ($subpath) = @_;
local $/=undef;
- my $cmd = "$dgitlive/dgit -d $distro \$DGIT_TEST_OPTS";
+ my $cmd = "$dgitlive/dgit -d$distro \$DGIT_TEST_OPTS";
$cmd .= " -".("D" x $debuglevel) if $debuglevel;
$cmd .= " archive-api-query $subpath";
printdebug "apiquery $cmd\n";
defined $json or die "$subpath $! $?";
my $r = decode_json $json;
my $d = new Data::Dumper([$r], [qw(r)]);
- printdebug "apiquery $subpath | ", $d->Dump(), "\n" if $debuglevel>=2;
+ printdebug "apiquery $subpath | ", $d->Dump() if $debuglevel>=2;
return $r;
}
" removed from NEW (ie, rejected) (or never arrived)");
}
-sub action__check_package () {
+sub action_check_package () {
getpackage();
return 0 unless $pkg_exists;
return 0 unless $pkg_secret;
sub action_push_confirm () {
getpackage();
- die unless @ARGV;
- my $freshrepo = shift @ARGV;
+ die unless @ARGV >= 5;
+ my $freshrepo = $ARGV[4];
my $initq = $poldbh->prepare(<<END);
SELECT taint_id, gitobjid FROM taints t
my $oldmode = ((stat _)[2]);
my $oldwrites = $oldmode & 0222;
# remove r and x bits which have corresponding w bits clear
- my $newmode = $oldmode & ($oldwrites << 1) & ($oldwrites > 1);
+ my $newmode = $oldmode &
+ (~0555 | ($oldwrites << 1) | ($oldwrites >> 1));
+ printdebug sprintf "chmod %#o (was %#o) %s\n",
+ $newmode, $oldmode, $freshrepo;
chmod $newmode, $freshrepo or die $!;
}
}