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"
33 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
36 testequalpolicy
100 1 -o Test
=NotAutomatic
37 testequalpolicy
990 1 -o Test
=NotAutomatic
-t now
39 sed -i aptarchive
/Release
-e 1i
"ButAutomaticUpgrades: yes"
40 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
43 testequalpolicy
100 100 -o Test
=ButAutomaticUpgrades
44 testequalpolicy
990 100 -o Test
=ButAutomaticUpgrades
-t now
46 sed -i aptarchive
/Release
-e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d'
47 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
50 testequalpolicy
100 500 -o Test
=Automatic
51 testequalpolicy
990 500 -o Test
=Automatic
-t now
53 buildsimplenativepackage
"coolstuff" "all" "1.0" "stable"
54 buildsimplenativepackage
"coolstuff" "all" "2.0~bpo1" "backports"
58 testequalpolicycoolstuff
() {
59 local INSTALLED
="${1:-(none)}"
60 local CANDIDATE
="${2:-(none)}"
65 if [ -n "$PINVERSION" ]; then
66 PINVERSION
="Package pin: $PINVERSION
73 [ "$1" = "2.0~bpo1" ] && IB
="***" && SB
="
74 100 $STATUS" || IB
=" "
75 [ "$1" = "1.0" ] && IS
="***" && SS
="
76 100 $STATUS" || IS
=" "
79 if [ ! "$7" = "2.0~bpo2" ]; then
80 BPO1ARCHIVE
=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
84 $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
85 SB
="$(echo "$SB" | tail -n 1)"
92 ${PINVERSION}Version table:${BPO2ARCHIVE}
96 $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ stable/main i386 Packages$SS" \
97 aptcache policy coolstuff
-o Policy
=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $
*
100 testequalpolicycoolstuff
"" "2.0~bpo1" 500 500 0 ""
101 testequalpolicycoolstuff
"" "1.0" 500 990 0 "" -t stable
102 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -t backports
104 Pin: release n=backports
105 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
106 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=GlobalPin
107 testequalpolicycoolstuff
"" "1.0" 200 990 0 "" -o Test
=GlobalPin
-t stable
108 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=GlobalPin
-t backports
110 Pin: release n=backports
111 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
112 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=GlobalPin
113 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=GlobalPin
-t stable
114 echo "Package: coolstuff
115 Pin: release n=backports
116 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
117 #FIXME: policy can't differentiate between two sources where one has a package specific pin in place
118 # testequalpolicycoolstuff "" "1.0" 500 500 200 "2.0~bpo1" -o Test=PackagePin
119 # testequalpolicycoolstuff "" "1.0" 990 500 200 "2.0~bpo1" -o Test=PackagePin -t backports
120 testequalpolicycoolstuff
"" "1.0" 500 990 200 "2.0~bpo1" -o Test
=PackagePin
-t stable
121 echo "Package: coolstuff
122 Pin: release n=backports
123 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
124 testequalpolicycoolstuff
"" "2.0~bpo1" 500 500 600 "2.0~bpo1" -o Test
=PackagePin
125 testequalpolicycoolstuff
"" "1.0" 500 990 600 "2.0~bpo1" -o Test
=PackagePin
-t stable
126 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=PackagePin
-t backports
128 echo "Package: coolstuff
129 Pin: release n=backports
130 Pin-Priority: -1" > rootdir
/etc
/apt
/preferences
131 # testequalpolicycoolstuff "" "1.0" 500 500 -1 "2.0~bpo1" -o Test=PackagePin
132 # testequalpolicycoolstuff "" "1.0" 990 500 -1 "2.0~bpo1" -o Test=PackagePin -t backports
133 # testequalpolicycoolstuff "" "1.0" 500 990 -1 "2.0~bpo1" -o Test=PackagePin -t stable
135 rm rootdir
/etc
/apt
/preferences
136 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"NotAutomatic: yes"
138 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
141 testequalpolicycoolstuff
"" "1.0" 1 500 0 "" -o Test
=NotAutomatic
142 testequalpolicycoolstuff
"" "1.0" 1 990 0 "" -o Test
=NotAutomatic
-t stable
143 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=NotAutomatic
-t backports
145 Pin: release n=backports
146 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
147 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=NotAutomatic
149 Pin: release n=backports
150 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
151 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=NotAutomatic
152 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=NotAutomatic
-t stable
153 echo "Package: coolstuff
154 Pin: release n=backports
155 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
156 testequalpolicycoolstuff
"" "1.0" 1 500 200 "2.0~bpo1" -o Test
=NotAutomatic
157 echo "Package: coolstuff
158 Pin: release n=backports
159 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
160 testequalpolicycoolstuff
"" "2.0~bpo1" 1 500 600 "2.0~bpo1" -o Test
=NotAutomatic
161 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=NotAutomatic
-t backports
162 testequalpolicycoolstuff
"" "1.0" 1 990 600 "2.0~bpo1" -o Test
=NotAutomatic
-t stable
164 rm rootdir
/etc
/apt
/preferences
165 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"ButAutomaticUpgrades: yes"
167 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
170 testequalpolicycoolstuff
"" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
171 testequalpolicycoolstuff
"" "1.0" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
172 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
174 Pin: release n=backports
175 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
176 testequalpolicycoolstuff
"" "1.0" 200 500 0 "" -o Test
=ButAutomaticUpgrades
178 Pin: release n=backports
179 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
180 testequalpolicycoolstuff
"" "2.0~bpo1" 600 500 0 "" -o Test
=ButAutomaticUpgrades
181 testequalpolicycoolstuff
"" "1.0" 600 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
182 echo "Package: coolstuff
183 Pin: release n=backports
184 Pin-Priority: 200" > rootdir
/etc
/apt
/preferences
185 testequalpolicycoolstuff
"" "1.0" 100 500 200 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
186 echo "Package: coolstuff
187 Pin: release n=backports
188 Pin-Priority: 600" > rootdir
/etc
/apt
/preferences
189 testequalpolicycoolstuff
"" "2.0~bpo1" 100 500 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
190 testequalpolicycoolstuff
"" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
-t backports
191 testequalpolicycoolstuff
"" "1.0" 100 990 600 "2.0~bpo1" -o Test
=ButAutomaticUpgrades
-t stable
193 rm rootdir
/etc
/apt
/preferences
194 aptget
install coolstuff
-qq > /dev
/null
2> /dev
/null
195 testequalpolicycoolstuff
"1.0" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
196 aptget dist
-upgrade -qq > /dev
/null
2> /dev
/null
197 testequalpolicycoolstuff
"1.0" "1.0" 100 500 0 "" -o Test
=ButAutomaticUpgrades
198 testequalpolicycoolstuff
"1.0" "1.0" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
199 testequalpolicycoolstuff
"1.0" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
201 aptget
install coolstuff
-t backports
-qq > /dev
/null
2> /dev
/null
202 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test
=ButAutomaticUpgrades
203 aptget dist
-upgrade -qq > /dev
/null
2> /dev
/null
204 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test
=ButAutomaticUpgrades
205 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test
=ButAutomaticUpgrades
-t stable
206 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test
=ButAutomaticUpgrades
-t backports
208 rm incoming
/backports.main.pkglist incoming
/backports.main.srclist
209 buildsimplenativepackage
"coolstuff" "all" "2.0~bpo2" "backports"
212 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"NotAutomatic: yes"
214 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
217 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test
=NotAutomatic
218 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test
=NotAutomatic
-t stable
219 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test
=NotAutomatic
-t backports
221 sed -i aptarchive
/dists
/backports
/Release
-e 1i
"ButAutomaticUpgrades: yes"
223 rm rootdir
/var
/cache
/apt
/srcpkgcache.bin rootdir
/var
/cache
/apt
/pkgcache.bin
226 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
227 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
-t stable
228 testequalpolicycoolstuff
"2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test
=ButAutomaticUpgrades
-t backports