X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/71e22da91ff888cf645e5083fbac7839846111d2..757ec4e1ef633f9867928559df82adf3d0ac7b78:/test/integration/framework

diff --git a/test/integration/framework b/test/integration/framework
index 677c40711..c513ed12c 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -195,6 +195,9 @@ aptinternalplanner() { runapt "${APTINTERNALPLANNER}" "$@"; }
 dpkg() {
 	"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "$@"
 }
+dpkg_version() {
+	command perl -MDpkg -E 'say $Dpkg::PROGVERSION'
+}
 dpkgcheckbuilddeps() {
 	command dpkg-checkbuilddeps --admindir="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg" "$@"
 }
@@ -311,7 +314,7 @@ setupenvironment() {
 		# relax permissions so that running as root with user switching works
 		umask 022
 		chmod 711 "$TMPWORKINGDIRECTORY"
-		chown _apt:root "${TMPWORKINGDIRECTORY}/downloaded"
+		chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/downloaded"
 	fi
 
 	TESTDIRECTORY="$(readlink -f "$(dirname $0)")"
@@ -439,7 +442,7 @@ EOF
 
 	cp "${TESTDIRECTORY}/apt.pem" "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
 	if [ "$(id -u)" = '0' ]; then
-		chown _apt:root "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
+		chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
 	fi
 	echo "Acquire::https::CaInfo \"${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem\";" > rootdir/etc/apt/apt.conf.d/99https
 	echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
@@ -528,7 +531,7 @@ configdpkg() {
 			insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
 		fi
 	fi
-	if command dpkg --assert-multi-arch >/dev/null 2>&1 ; then
+	if dpkg --assert-multi-arch >/dev/null 2>&1 ; then
 		local ARCHS="$(getarchitectures)"
 		local DPKGARCH="$(dpkg --print-architecture)"
 		# this ensures that even if multi-arch isn't active in the view
@@ -1957,7 +1960,7 @@ mkdir() {
 		command mkdir -m 700 -p "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
 		touch "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/lock"
 		if [ "$(id -u)" = '0' ]; then
-			chown _apt:root "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
+			chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
 		fi
 	else
 		command mkdir "$@"