From 158fda31be7d4ae1c80a56223faa8d01efc25acc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 2 Sep 2010 12:22:33 +0200 Subject: add wrapper around dpkg to be able to use it easily in the tests --- test/integration/framework | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/framework b/test/integration/framework index 8efe47330..ba5f9dfa3 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -72,6 +72,9 @@ aptconfig() { runapt apt-config $*; } aptcache() { runapt apt-cache $*; } aptget() { runapt apt-get $*; } aptftparchive() { runapt apt-ftparchive $*; } +dpkg() { + $(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $* +} setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) @@ -228,6 +231,10 @@ buildaptarchive() { createaptftparchiveconfig() { local ARCHS="$(find pool/ -name '*.deb' | grep -oE '_[a-z0-9-]+\.deb$' | sort | uniq | sed -e '/^_all.deb$/ d' -e 's#^_\([a-z0-9-]*\)\.deb$#\1#' | tr '\n' ' ')" + if [ -z "$ARCHS" ]; then + # the pool is empty, so we will operate on faked packages - let us use the configured archs + ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + fi echo -n 'Dir { ArchiveDir "' >> ftparchive.conf echo -n $(readlink -f .) >> ftparchive.conf -- cgit v1.2.3