4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64'
9 buildsimplenativepackage 'foo-1' 'all' '2' 'unstable'
10 buildsimplenativepackage 'foo-2' 'amd64' '2' 'unstable'
11 setupaptarchive --no-update
13 cat >rootdir/etc/apt/apt.conf.d/get-contents <<EOF
14 Acquire::IndexTargets::deb::Contents {
15 MetaKey "\
$(COMPONENT)/Contents
-\
$(ARCHITECTURE)";
16 ShortDescription "Contents
";
17 Description "\
$(RELEASE)/\
$(COMPONENT) \
$(ARCHITECTURE) Contents
";
18 KeepCompressed "true
";
22 msgmsg 'Releasefile with Architectures field and all included'
23 testsuccess apt update
24 cp rootdir/tmp/testsuccess.output aptupdate.output
25 testsuccess grep '^Get.* all Packages ' aptupdate.output
26 testsuccess grep '^Get.* all Contents ' aptupdate.output
28 foo-2' aptcache pkgnames foo-
30 listcurrentlistsdirectory > lists.before
31 testsuccess grep '_binary-all_Packages' lists.before
32 testsuccess grep '_Contents-all\.' lists.before
34 configarchitecture 'amd64' 'i386'
35 testsuccessequal "All packages are up to
date.
36 N
: Skipping acquire of configured
file 'main/binary-i386/Packages' as repository
'file:$(readlink -f ./aptarchive) unstable InRelease' doesn
't support architecture 'i386
'" apt update -o quiet::NoProgress=1
37 testfileequal lists.before "$(listcurrentlistsdirectory)"
39 foo
-2' aptcache pkgnames foo-
41 rm -rf rootdir/var/lib/apt/lists
42 msgmsg 'Releasefile has all
, but forbids its usage
'
43 configarchitecture 'amd64
'
44 sed -i '/^Architectures
: / a\
45 No
-Support-for-Architecture-all: Packages
' $(find ./aptarchive -name 'Release')
47 testsuccess apt update
48 cp rootdir/tmp/testsuccess.output aptupdate.output
49 testfailure grep '^Get.
* all Packages
' aptupdate.output
50 testsuccess grep '^Get.
* all Contents
' aptupdate.output
51 sed -i '/^No
-Support-for-Architecture-all: / d
' $(find ./aptarchive -name 'Release')
53 rm -rf rootdir/var/lib/apt/lists
54 msgmsg 'Releasefile with Architectures field but without all
'
55 configarchitecture 'amd64
' 'i386
'
56 getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; }
59 testsuccessequal 'All packages are up to
date.
' apt update -o quiet::NoProgress=1
60 cp rootdir/tmp/testsuccess.output aptupdate.output
61 testfailure grep '^Get.
* all Packages
' aptupdate.output
62 testfailure grep '^Get.
* all Contents
' aptupdate.output
63 testequal 'foo
-2' aptcache pkgnames foo-
65 configarchitecture 'amd64
'
66 testsuccess apt update
67 cp rootdir/tmp/testsuccess.output aptupdate.output
68 testfailure grep '^Get.
* all Packages
' aptupdate.output
69 testfailure grep '^Get.
* all Contents
' aptupdate.output
70 testequal 'foo
-2' aptcache pkgnames foo-
72 rm -rf rootdir/var/lib/apt/lists
73 msgmsg 'Releasefile without Architectures field
'
74 getarchitecturesfromreleasefile() { echo -n ''; }
77 testfailure grep '^Architectures
: ' $(find ./aptarchive -name 'Release')
78 testsuccess apt update
79 cp rootdir/tmp/testsuccess.output aptupdate.output
80 testsuccess grep '^Get.
* all Packages
' aptupdate.output
81 testsuccess grep '^Get.
* all Contents
' aptupdate.output
83 foo
-2' aptcache pkgnames foo-
85 # apt doesn't know supported archs
, so missing a configured arch is a failure
86 configarchitecture
'amd64' 'i386'
87 testfailure apt update
89 foo-2' aptcache pkgnames foo
-
91 rm -rf rootdir
/var
/lib
/apt
/lists
92 msgmsg
'Releasefile no Architectures all, but forbids its usage'
93 configarchitecture
'amd64'
95 No-Support-for-Architecture-all: Packages' $(find ./aptarchive -name 'Release')
97 testsuccess apt update
98 cp rootdir
/tmp
/testsuccess.output aptupdate.output
99 testfailure
grep '^Get.* all Packages ' aptupdate.output
100 testsuccess
grep '^Get.* all Contents ' aptupdate.output
101 sed -i '/^No-Support-for-Architecture-all: / d' $(find ./aptarchive -name 'Release')
103 msgmsg
'No Releasefile'
104 rm -rf rootdir
/var
/lib
/apt
/lists
105 find aptarchive
-name '*Release*' -delete
106 configarchitecture
'amd64'
107 testfailure apt update
108 testwarning apt update
--allow-insecure-repositories
110 foo-2' aptcache pkgnames foo
-