X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=infra%2Fdgit-repos-policy-debian;h=b21f797643a76ea27e19c93e6202c103ec644c21;hp=a770c55ec07d40e5858c2c782c41934a6ecab8f1;hb=c315665ee5ff99ad78b4621abfd6be0d73b4e0c9;hpb=520d2b03770aeb7be9b63fbdddb9ad896d535732 diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index a770c55e..b21f7976 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -86,7 +86,9 @@ our %deliberately; 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"; @@ -459,17 +461,18 @@ my @orgargv = @ARGV; 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;