sub apiquery ($) {
my ($subpath) = @_;
local $/=undef;
- my $cmd = "$dgitlive/dgit -d$distro \$DGIT_TEST_OPTS";
+ my $dgit = "$dgitlive/dgit";
+ $dgit = "dgit" if !stat_exists $dgit;
+ my $cmd = "$dgit -d$distro \$DGIT_TEST_OPTS";
$cmd .= " -".("D" x $debuglevel) if $debuglevel;
$cmd .= " archive-api-query $subpath";
printdebug "apiquery $cmd\n";
foreach my $entry (@$in_suite) {
my $vsn = $entry->{version};
die "$pkg ?" unless defined $vsn;
- my $tagref = "refs/tags/".debiantag $vsn;
+ my $tagref = "refs/tags/".debiantag $vsn, $distro;
printdebug " checking history suite=$suite vsn=$vsn tagref=$tagref\n";
$?=0; my $r = system qw(git show-ref --verify --quiet), $tagref;
return 1 if !$r;
for (;;) {
@ARGV = @orgargv;
eval {
- poldb_setup(poldb_path($repos));
- $stderr = '';
+ poldb_setup(poldb_path($repos), sub {
+ $poldbh->{HandleError} = sub {
+ return 0 unless $poldbh->err == 5; # SQLITE_BUSY, not in .pm :-(
+ die bless { }, $db_busy_exception;
+ };
- eval ($ENV{'DGIT_DRS_RPD_TEST_DBLOOP_HOOK'}//'');
- die $@ if length $@;
- # used by tests/tests/debpolicy-dbretry
+ eval ($ENV{'DGIT_RPD_TEST_DBLOOP_HOOK'}//'');
+ die $@ if length $@;
+ # used by tests/tests/debpolicy-dbretry
+ });
- $poldbh->{HandleError} = sub {
- return 0 unless $poldbh->err == 5; # SQLITE_BUSY, not in .pm :-(
- die bless { }, $db_busy_exception;
- };
+ $stderr = '';
$rcode = $fn->();
die unless defined $rcode;