while [ -n "$1" ]; do
if [ "$1" = "-q" ]; then
export MSGLEVEL=2
+ elif [ "$1" = "-qq" ]; then
+ export MSGLEVEL=1
elif [ "$1" = "-v" ]; then
export MSGLEVEL=4
elif [ "$1" = '--color=no' ]; then
msgdebug() { true; }
msgndebug() { true; }
fi
+if [ $MSGLEVEL -le 1 ]; then
+ msgpass() { true; }
+fi
msgdone() {
if [ "$1" = "debug" -a $MSGLEVEL -le 4 ] ||
[ "$1" = "info" -a $MSGLEVEL -le 3 ] ||
local STATUSFILE="status-${BASENAME#*-}"
if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
+ # Add an empty line to the end if there is none
+ if tail -1 rootdir/var/lib/dpkg/status | grep -q .; then
+ echo >> rootdir/var/lib/dpkg/status
+ fi
else
echo -n > rootdir/var/lib/dpkg/status
fi
fi
rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
- # if multi-arch make sure dpkg can detect itself as capable of it
- if getarchitectures | grep -E -q '[^ ]+ [^ ]+'; then
- if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
- # dpkg doesn't really check the version as long as it is fully installed,
- # but just to be sure we choose one above the required version
- insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
- fi
+ # make sure dpkg can detect itself as capable of it
+ if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
+ # dpkg doesn't really check the version as long as it is fully installed,
+ # but just to be sure we choose one above the required version
+ insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
fi
if dpkg --assert-multi-arch >/dev/null 2>&1 ; then
local ARCHS="$(getarchitectures)"
if [ "$ARCH" = "all" ]; then
ARCH="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)"
fi
- testsuccess --nomsg dpkg-buildpackage -uc -us -a$ARCH
+ testsuccess --nomsg dpkg-buildpackage -uc -us -a$ARCH -d
cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$BUILDLOG"
local PKGS="$(grep '^dpkg-deb: building package' "$BUILDLOG" | cut -d'/' -f 2 | sed -e "s#'\.##")"
local SRCS="$(grep '^dpkg-source: info: building' "$BUILDLOG" | grep -o '[a-z0-9._+~-]*$')"