echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
- echo "Debug::NoLocking \"true\";" >> aptconfig.conf
echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf
# store apt-key were we can access it, even if we run it as a different user
aptautotest_aptget_update() {
if ! test -d "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"; then return; fi
# all copied files are properly chmodded
- for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -maxdepth 1 -type f); do
+ for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -maxdepth 1 -type f ! -name 'lock'); do
testfilestats "$file" '%U:%G:%a' '=' "${USER}:${USER}:644"
done
}
E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
# no package foo
-testequal "Listing..." apt list foo
-testequal "partial" ls rootdir/var/lib/apt/lists
+testequal 'Listing...' apt list foo
+testequal 'lock
+partial' ls rootdir/var/lib/apt/lists
# allow override
testequal "Ign file: unstable InRelease
msgmsg 'Test with no initial data over' "$1"
rm -rf rootdir/var/lib/apt/lists
mkdir -m 700 -p rootdir/var/lib/apt/lists/partial
+ touch rootdir/var/lib/apt/lists/lock
if [ "$(id -u)" = '0' ]; then
chown _apt:root rootdir/var/lib/apt/lists/partial
fi
aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail
ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0
-testequal 'partial' ls $LISTS
+testequal 'lock
+partial' ls $LISTS
# and again with pre-existing files with "valid data" which should remain
for f in Release Release.gpg main_binary-amd64_Packages main_source_Sources; do