diff options
author | martin@piware.de <> | 2010-06-15 13:17:33 +0200 |
---|---|---|
committer | martin@piware.de <> | 2010-06-15 13:17:33 +0200 |
commit | 8d48388ebfb69ab21a50d068275d2f6b7abffb87 (patch) | |
tree | 135d622ed610b797288400b5cb9875aaa3231923 /test/test-indexes.sh | |
parent | 94e8c9d4df70d2532e1640dfe2700dd63a094a4f (diff) |
test/test-indexes.sh: Stop hardcoding archive gpg key ID, get it from first failed apt-get update output
Diffstat (limited to 'test/test-indexes.sh')
-rwxr-xr-x | test/test-indexes.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/test-indexes.sh b/test/test-indexes.sh index e82633022..58b9cff72 100755 --- a/test/test-indexes.sh +++ b/test/test-indexes.sh @@ -8,7 +8,6 @@ BUILDDIR=$(readlink -f $(dirname $0)/../build) TEST_SOURCE="http://ftp.debian.org/debian unstable contrib" -TEST_SOURCE_KEYID=55BE302B GPG_KEYSERVER=gpg-keyserver.de # should be a small package with dependencies satisfiable in TEST_SOURCE, i. e. # ideally no depends at all @@ -42,11 +41,15 @@ touch var/lib/dpkg/status echo "deb $TEST_SOURCE" > etc/apt/sources.list echo "deb-src $TEST_SOURCE" >> etc/apt/sources.list -# get keyring -gpg --no-options --no-default-keyring --secret-keyring etc/apt/secring.gpg --trustdb-name etc/apt/trustdb.gpg --keyring etc/apt/trusted.gpg --primary-keyring etc/apt/trusted.gpg --keyserver $GPG_KEYSERVER --recv-keys $TEST_SOURCE_KEYID - echo "---- uncompressed update ----" +# first attempt should fail, no trusted GPG key +out=$($APT_GET update 2>&1) +echo "$out" | grep -q NO_PUBKEY +key=$(echo "$out" | sed -n '/NO_PUBKEY/ { s/^.*NO_PUBKEY \([[:alnum:]]\+\)$/\1/; p}') +# get keyring +gpg --no-options --no-default-keyring --secret-keyring etc/apt/secring.gpg --trustdb-name etc/apt/trustdb.gpg --keyring etc/apt/trusted.gpg --primary-keyring etc/apt/trusted.gpg --keyserver $GPG_KEYSERVER --recv-keys $key $APT_GET update + test -e var/lib/apt/lists/*_Packages test -e var/lib/apt/lists/*_Sources ! test -e var/lib/apt/lists/*_Packages.gz |