4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
13 STATUS
=$(readlink -f rootdir/var/lib/dpkg/status)
14 APTARCHIVE
=$(readlink -f aptarchive)
20 testequal
"Package files:
21 $(echo "$SP" | awk '{ printf("%3s\n",$0) }') ${STATUS}
23 $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ Packages
25 Pinned packages:" aptcache policy $
*
29 testequalpolicy
100 500
30 testequalpolicy
990 500 -t now
32 sed -i aptarchive
/Release
-e 1i
"NotAutomatic: yes"
35 testequalpolicy
100 1 -o Test
=NotAutomatic
36 testequalpolicy
990 1 -o Test
=NotAutomatic
-t now
38 sed -i aptarchive
/Release
-e 1i
"ButAutomaticUpgrades: yes"
41 testequalpolicy
100 100 -o Test
=ButAutomaticUpgrades
42 testequalpolicy
990 100 -o Test
=ButAutomaticUpgrades
-t now
44 sed -i aptarchive
/Release
-e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d'
47 testequalpolicy
100 500 -o Test
=Automatic
48 testequalpolicy
990 500 -o Test
=Automatic
-t now
50 buildsimplenativepackage
"coolstuff" "all" "1.0" "stable"
51 buildsimplenativepackage
"coolstuff" "all" "2.0~bpo1" "backports"
55 testequalpolicycoolstuff
() {
56 local INSTALLED
="${1:-(none)}"
57 local CANDIDATE
="${2:-(none)}"
62 if [ -n "$PINVERSION" ]; then
63 PINVERSION
="Package pin: $PINVERSION
70 [ "$1" = "2.0~bpo1" ] && IB
="***" && SB
="
71 100 $STATUS" || IB
=" "
72 [ "$1" = "1.0" ] && IS
="***" && SS
="
73 100 $STATUS" || IS
=" "
76 if [ ! "$7" = "2.0~bpo2" ]; then
77 BPO1ARCHIVE
=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
81 $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
82 SB
="$(echo "$SB" | tail -n 1)"
89 ${PINVERSION}Version table:${BPO2ARCHIVE}
93 $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ stable/main i386 Packages$SS" \
94 aptcache policy coolstuff
-o Policy
=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $
*
97 testequalpolicycoolstuff
"" "2.0~bpo1" 500 500 0 ""
98 testequalpolicycoolstuff
"" "1.0" 500 990 0 "" -t stable
99 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -t backports
101 Pin: release n=backports
102 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
103 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=GlobalPin
104 testequalpolicycoolstuff
"" "1.0" 200 990 0 "" -o Test
=GlobalPin
-t stable
105 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=GlobalPin
-t backports
107 Pin: release n=backports
108 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
109 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=GlobalPin
110 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=GlobalPin
-t stable
111 echo "Package: coolstuff
112 Pin: release n=backports
113 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
114 #FIXME: policy can't differentiate between two sources where one has a package specific pin in place
115 # testequalpolicycoolstuff "" "1.0" 500 500 200 "2.0~bpo1" -o Test=PackagePin
116 # testequalpolicycoolstuff "" "1.0" 990 500 200 "2.0~bpo1" -o Test=PackagePin -t backports
117 testequalpolicycoolstuff
"" "1.0" 500 990 200 "2.0~bpo1" -o Test
=PackagePin
-t stable
118 echo "Package: coolstuff
119 Pin: release n=backports
120 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
121 testequalpolicycoolstuff
"" "2.0~bpo1" 500 500 600 "2.0~bpo1" -o Test
=PackagePin
122 testequalpolicycoolstuff
"" "1.0" 500 990 600 "2.0~bpo1" -o Test
=PackagePin
-t stable
123 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=PackagePin
-t backports
125 echo "Package: coolstuff
126 Pin: release n=backports
127 Pin-Priority: -1" > rootdir
/etc
/apt
/preferences
128 # testequalpolicycoolstuff "" "1.0" 500 500 -1 "2.0~bpo1" -o Test=PackagePin
129 # testequalpolicycoolstuff "" "1.0" 990 500 -1 "2.0~bpo1" -o Test=PackagePin -t backports
130 # testequalpolicycoolstuff "" "1.0" 500 990 -1 "2.0~bpo1" -o Test=PackagePin -t stable
132 rm rootdir
/etc
/apt
/preferences
133 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"NotAutomatic: yes"
137 testequalpolicycoolstuff
"" "1.0" 1 500 0 "" -o Test
=NotAutomatic
138 testequalpolicycoolstuff
"" "1.0" 1 990 0 "" -o Test
=NotAutomatic
-t stable
139 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=NotAutomatic
-t backports
141 Pin: release n=backports
142 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
143 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=NotAutomatic
145 Pin: release n=backports
146 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
147 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=NotAutomatic
148 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=NotAutomatic
-t stable
149 echo "Package: coolstuff
150 Pin: release n=backports
151 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
152 testequalpolicycoolstuff
"" "1.0" 1 500 200 "2.0~bpo1" -o Test
=NotAutomatic
153 echo "Package: coolstuff
154 Pin: release n=backports
155 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
156 testequalpolicycoolstuff
"" "2.0~bpo1" 1 500 600 "2.0~bpo1" -o Test
=NotAutomatic
157 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=NotAutomatic
-t backports
158 testequalpolicycoolstuff
"" "1.0" 1 990 600 "2.0~bpo1" -o Test
=NotAutomatic
-t stable
160 rm rootdir
/etc
/apt
/preferences
161 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"ButAutomaticUpgrades: yes"
165 testequalpolicycoolstuff
"" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
166 testequalpolicycoolstuff
"" "1.0" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
167 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
169 Pin: release n=backports
170 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
171 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=ButAutomaticUpgrades
173 Pin: release n=backports
174 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
175 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=ButAutomaticUpgrades
176 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
177 echo "Package: coolstuff
178 Pin: release n=backports
179 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
180 testequalpolicycoolstuff
"" "1.0" 100 500 200 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
181 echo "Package: coolstuff
182 Pin: release n=backports
183 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
184 testequalpolicycoolstuff
"" "2.0~bpo1" 100 500 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
185 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
-t backports
186 testequalpolicycoolstuff
"" "1.0" 100 990 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
-t stable
188 rm rootdir
/etc
/apt
/preferences
189 aptget
install coolstuff
-qq > /dev
/null
2> /dev
/null
190 testequalpolicycoolstuff
"1.0" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
191 aptget dist
-upgrade -qq > /dev
/null
2> /dev
/null
192 testequalpolicycoolstuff
"1.0" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
193 testequalpolicycoolstuff
"1.0" "1.0" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
194 testequalpolicycoolstuff
"1.0" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
196 aptget
install coolstuff
-t backports
-qq > /dev
/null
2> /dev
/null
197 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test
=ButAutomaticUpgrades
198 aptget dist
-upgrade -qq > /dev
/null
2> /dev
/null
199 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test
=ButAutomaticUpgrades
200 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
201 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
203 rm incoming
/backports.main.pkglist incoming
/backports.main.srclist
204 buildsimplenativepackage
"coolstuff" "all" "2.0~bpo2" "backports"
207 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"NotAutomatic: yes"
211 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test
=NotAutomatic
212 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test
=NotAutomatic
-t stable
213 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test
=NotAutomatic
-t backports
215 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"ButAutomaticUpgrades: yes"
219 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
220 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
-t stable
221 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
-t backports