Even if we only configure a single architecture, install dpkg, so
dpkg can assert multi arch correctly. This also has the nice side
effect of making single architecture and multiple architecture
test cases more uniform.
This fixes a regression from
f878d3a862128bc1385616751ae1d78246b1bd01
("test: Assert multi-arch in the chroot").
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)"
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]
baz/unstable 2.0 all [upgradable from: 0.1]
+dpkg/now 1.16.2+fake all [installed,local]
foo/unstable 1.0 all
foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]
baz/now 0.1 all [installed,upgradable to: 2.0]
+dpkg/now 1.16.2+fake all [installed,local]
foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed
testsuccessequal "Listing...
setupaptarchive
testmarkedauto
-testmarkedmanual
+testmarkedmanual 'dpkg'
testsuccess aptget install libabc/stable -y
testdpkginstalled 'libabc'
testdpkgnotinstalled 'libdef'
-testmarkedmanual 'libabc'
+testmarkedmanual 'dpkg' 'libabc'
testmarkedauto
testsuccess aptget dist-upgrade -y
testdpkginstalled 'libabc' 'libdef'
testmarkedauto 'libabc'
-testmarkedmanual 'libdef'
+testmarkedmanual 'dpkg' 'libdef'
assert_repo_is_intact()
{
- testsuccessequal "foo/unstable 2.0 all" apt list -qq
+ testsuccessequal "dpkg/now 1.16.2+fake all [installed,local]
+foo/unstable 2.0 all" apt list -qq
testsuccess aptget install -y -s foo
testfailure aptget install -y evil
testsuccess aptget source foo --print-uris
create_fresh_archive
testsuccess aptget update
listcurrentlistsdirectory > lists.before
- testsuccessequal 'old/unstable 1.0 all' apt list -qq
+ testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local]
+old/unstable 1.0 all' apt list -qq
}
test_inrelease_to_new_inrelease() {
add_new_package '+1hour'
testsuccess aptget update -o Debug::Acquire::Transaction=1
- testsuccessequal 'new/unstable 1.0 all
+ testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local]
+new/unstable 1.0 all
old/unstable 1.0 all' apt list -qq
}
testsuccess aptget update -o Debug::Acquire::gpg=1
unset TMPDIR
-testsuccessequal 'coolstuff' aptcache pkgnames
+testsuccessequal 'coolstuff
+dpkg' aptcache pkgnames
testsuccess ls rootdir/var/lib/apt/lists/*InRelease
testsuccessequal "Listing...
bar/testing 2 all [upgradable from: 1]
+dpkg/now 1.16.2+fake all [installed,local]
foo/testing,now 1 all [installed]" apt list
Install: libfoo:amd64 foo:amd64
Planner: internal' head -n 6 "$EIPPLOG"
aptinternalplanner < "$EIPPLOG" > planner.log || true
-testsuccessequal 'Remove: 6
+testsuccessequal 'Remove: 7
Unpack: 2
Unpack: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log