X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=infra%2Fdgit-repos-policy-debian;h=b21f797643a76ea27e19c93e6202c103ec644c21;hp=339081e93987c569783665c10aef56c80dbcb663;hb=76cbbc78a07e44b4c917bbaa93bf7cd602387082;hpb=68ace2786dc26749014ea70a6ebb2b896b1f25d1 diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 339081e9..b21f7976 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -461,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;