$cmd .= " archive-api-query $subpath";
printdebug "apiquery $cmd\n";
$!=0; $?=0; my $json = `$cmd`;
- defined $json or die "$subpath $! $?";
+ 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;
}
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 $!;
}
}
statpackage();
next unless $pkg_exists;
next unless $pkg_secret;
- printdebug "$pkg\n" or die $!;
+ print "$pkg\n" or die $!;
}
closedir L or die $!;
close STDOUT or die $!;