From: Ian Jackson Date: Mon, 11 May 2015 06:59:00 +0000 (+0100) Subject: dgit-repos-policy-debian: Fix error handling, and test fixes X-Git-Tag: debian/0.30~180 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=68fecefcb822012c8eaef19c4368a674111df509;hp=3eb14f7048c55754ee5ff6441623c0fe1ddd3641 dgit-repos-policy-debian: Fix error handling, and test fixes --- diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index b631d07e..ac427127 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -88,7 +88,7 @@ sub apiquery ($) { $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() if $debuglevel>=2; diff --git a/tests/lib b/tests/lib index 0e188cca..34281898 100644 --- a/tests/lib +++ b/tests/lib @@ -101,12 +101,15 @@ t-prep-newpackage () { t-archive-none () { p=$1 mkdir -p $tmp/aq $tmp/mirror/pool/main - mkdir -p $tmp/aq/dsc_in_suite $tmp/aq/dsc_in_suite/sid local suite=sid + >$tmp/aq/package.$suite.$p t-archive-updated $suite $p + >$tmp/aq/package.new.$p + t-archive-updated new $p + ln -s sid $tmp/aq/dsc_in_suite/unstable cat <<'END' >$tmp/aq/suites [ @@ -128,7 +131,9 @@ END t-archive-updated () { local suite=$1 local p=$2 - perl <$tmp/aq/package.$suite.$p >$tmp/aq/dsc_in_suite/$suite/$p -wne ' + local suitedir=$tmp/aq/dsc_in_suite/$suite + mkdir -p $suitedir + perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne ' use JSON; use strict; our @v;