]> git.saurik.com Git - apt.git/blame - test/integration/test-sourceslist-target-plusminus-options
show apt-key warnings in apt update
[apt.git] / test / integration / test-sourceslist-target-plusminus-options
CommitLineData
e6a12ff7
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
e6a12ff7
DK
6setupenvironment
7configarchitecture 'amd64'
8
9testtargets() {
10 msgtest 'Test acquired targets for' "$1"
11 shift
12 while [ -n "$1" ]; do
13 echo "$1"
14 shift
15 done | sort -u > expectedtargets.lst
16 aptget indextargets --no-release-info --format='$(CREATED_BY)' | sort -u > gottargets.lst
17 testfileequal --nomsg ./expectedtargets.lst "$(cat ./gottargets.lst)"
18}
19
20echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
21testtargets 'default' 'Packages' 'Translations'
22
9adb9778 23msgmsg 'Contents as a default target'
e6a12ff7
DK
24cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
25Acquire::IndexTargets::deb::Contents {
26 MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
27 ShortDescription "Contents";
28 Description "\$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
29};
39c724b4
DK
30Acquire::IndexTargets::deb::Contents2 {
31 MetaKey "Contents-\$(ARCHITECTURE)";
32 ShortDescription "Contents2";
33 Description "\$(RELEASE) \$(ARCHITECTURE) Contents2";
34 Fallback-Of "Contents";
35 Identifier "Contents";
36};
e6a12ff7 37EOF
9adb9778
DK
38
39echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 40testtargets 'default + Contents' 'Packages' 'Translations' 'Contents' 'Contents2'
e6a12ff7
DK
41
42echo 'deb [target=Packages] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
43testtargets 'force Packages target' 'Packages'
44
45echo 'deb [target=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
46testtargets 'force Contents target' 'Contents'
47
48echo 'deb [target=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
49testtargets 'force two targets' 'Contents' 'Translations'
50
51echo 'deb [target+=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 52testtargets 'add existing' 'Packages' 'Contents' 'Translations' 'Contents2'
e6a12ff7
DK
53
54echo 'deb [target+=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 55testtargets 'add non-existing' 'Packages' 'Contents' 'Translations' 'Contents2'
e6a12ff7
DK
56
57echo 'deb [target-=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 58testtargets 'remove existing' 'Packages' 'Contents2'
e6a12ff7
DK
59
60echo 'deb [target-=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 61testtargets 'remove non-existing' 'Packages' 'Contents' 'Translations' 'Contents2'
e6a12ff7
DK
62
63echo 'deb [AppStream=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 64testtargets 'activate non-existing' 'Packages' 'Contents' 'Translations' 'Contents2'
e6a12ff7
DK
65
66echo 'deb [AppStream=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 67testtargets 'deactivate non-existing' 'Packages' 'Contents' 'Translations' 'Contents2'
e6a12ff7
DK
68
69echo 'deb [Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 70testtargets 'activate existing' 'Packages' 'Contents' 'Contents2' 'Translations'
e6a12ff7
DK
71
72echo 'deb [Contents=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
73testtargets 'deactivate existing' 'Packages' 'Translations'
74
75echo 'deb [target=Packages Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 76testtargets 'explicit + activate' 'Packages' 'Contents' 'Contents2'
9adb9778 77
39c724b4
DK
78echo 'deb [Contents=yes,target+=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
79testtargets 'duplications are okay' 'Packages' 'Translations' 'Contents' 'Contents2'
9adb9778 80
39c724b4 81msgmsg 'Contents NOT as a default target (but Contents2)'
9adb9778
DK
82echo 'Acquire::IndexTargets::deb::Contents::DefaultEnabled "no";' > rootdir/etc/apt/apt.conf.d/content-target-notdefault.conf
83
84echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 85testtargets 'default + Contents' 'Packages' 'Translations' 'Contents2'
9adb9778
DK
86
87echo 'deb [target=Packages] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
88testtargets 'force Packages target' 'Packages'
89
90echo 'deb [target=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
91testtargets 'force Contents target' 'Contents'
92
93echo 'deb [target=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
94testtargets 'force two targets' 'Contents' 'Translations'
95
96echo 'deb [target+=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 97testtargets 'add existing' 'Packages' 'Contents' 'Translations' 'Contents2'
9adb9778
DK
98
99echo 'deb [target+=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 100testtargets 'add non-existing' 'Packages' 'Translations' 'Contents2'
9adb9778
DK
101
102echo 'deb [target-=Translations,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 103testtargets 'remove existing' 'Packages' 'Contents2'
9adb9778
DK
104
105echo 'deb [target-=AppStream] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 106testtargets 'remove non-existing' 'Packages' 'Translations' 'Contents2'
9adb9778
DK
107
108echo 'deb [AppStream=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 109testtargets 'activate non-existing' 'Packages' 'Translations' 'Contents2'
9adb9778
DK
110
111echo 'deb [AppStream=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 112testtargets 'deactivate non-existing' 'Packages' 'Translations' 'Contents2'
9adb9778
DK
113
114echo 'deb [Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4 115testtargets 'activate existing' 'Packages' 'Contents' 'Contents2' 'Translations'
9adb9778
DK
116
117echo 'deb [Contents=no] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
118testtargets 'deactivate existing' 'Packages' 'Translations'
119
120echo 'deb [target=Packages Contents=yes] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
39c724b4
DK
121testtargets 'explicit + activate' 'Packages' 'Contents' 'Contents2'
122
123echo 'deb [Contents=yes,target+=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
124testtargets 'duplications are okay' 'Packages' 'Translations' 'Contents' 'Contents2'