layeredupdate2.test 29.6 KB
Newer Older
Bernhard Link's avatar
Bernhard Link committed
1
set -u
2
. "$TESTSDIR"/test.inc
3 4 5

dodo test ! -d db
mkdir -p conf dists
6
echo "export silent-never" > conf/options
7 8 9 10 11 12 13 14 15 16 17
cat > conf/updatelog.sh <<EOF
#!/bin/sh
echo "\$@" >> '$WORKDIR/updatelog'
exit 0
EOF
cat > conf/shouldnothappen.sh <<EOF
#!/bin/sh
echo "\$@" >> '$WORKDIR/shouldnothappen'
exit 0
EOF
chmod a+x conf/updatelog.sh conf/shouldnothappen.sh
18 19 20 21
cat > conf/distributions <<EOF
Codename: boring
Suite: unstable
Components: main firmware
22
Architectures: abacus coal source
23 24 25
Log:
	--via update updatelog.sh
	--via include shouldnothappen.sh
26 27 28 29 30
Update: - 1 2 3 4

Codename: interesting
Suite: experimental
Components: main firmware
31
Architectures: abacus coal source
32 33 34 35 36 37 38 39 40 41 42 43
Update: 5 6 - 7 8

Codename: dummy
Components: dummycomponent
Architectures: dummyarchitecture
EOF
mkdir source1 source2
cat > conf/updates <<EOF
Name: a
VerifyRelease: blindtrust
Method: copy:$WORKDIR/source1
Architectures: dummyarchitecture
44
DownloadListsAs: .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma .lzma
45 46 47 48 49 50
Components: dummycomponent

Name: b
VerifyRelease: blindtrust
Method: copy:$WORKDIR/source2
Architectures: dummyarchitecture
Bernhard Link's avatar
Bernhard Link committed
51
DownloadListsAs: .lzma .bz2 .gz .
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
Flat: dummycomponent

Name: ca
From: a
Architectures: dummyarchitecture
Components: dummycomponent

Name: ma
From: ca
Architectures: dummyarchitecture
Components: main

Name: wa
From: ma
Suite: suitename
Architectures: source

Name: 3
From: wa

Name: 4
Suite: suitename
From: a
75
Architectures: abacus coal
76 77 78 79 80 81 82
#without this I do not get a warning, why?
Components: main firmware

Name: pre1
Flat: firmware
From: b
#without this I do not get a warning, why?
83
Architectures: abacus coal
84 85 86 87 88 89 90 91 92 93
FilterFormula: section (>=firmware/), section(<< firmware0)

Name: 1
From: pre1
Suite: x

Name: 2
Flat: main
From: b
#without this I do not get a warning, why?
94
Architectures: abacus coal source
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
FilterFormula: section (<<firmware/) | section(>= firmware0) | !section
Suite: x

Name: 5
From: b

Name: 6
From: b

Name: 7
From: b

Name: 8
From: b
EOF

DISTRI=dummy PACKAGE=aa EPOCH="" VERSION=1 REVISION=-1000 SECTION="base" genpackage.sh -sa
DISTRI=dummy PACKAGE=bb EPOCH="" VERSION=2 REVISION=-0 SECTION="firmware/base" genpackage.sh -sa
DISTRI=dummy PACKAGE=cc EPOCH="" VERSION=1 REVISION=-1000 SECTION="base" genpackage.sh -sa
DISTRI=dummy PACKAGE=dd EPOCH="" VERSION=2 REVISION=-0 SECTION="firmware/base" genpackage.sh -sa

116 117 118
mkdir source1/pool source1/pool/main source1/pool/firmware
mv aa* source1/pool/main
mv bb* source1/pool/firmware
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
mv cc* source2
mv dd* source2

mkdir source2/x
cd source2
echo 'dpkg-scanpackages . /dev/null > x/Packages'
dpkg-scanpackages . /dev/null > x/Packages
cd ..
cat > sourcesections <<EOF
cc standard base
dd standard firmware/base
EOF
cd source2
echo 'dpkg-scansources . sourcesections > x/Sources'
dpkg-scansources . ../sourcesections > x/Sources
cd ..
rm sourcesections

137
cat > source2/x/InRelease <<EOF
138 139
Codename: x
Suite: toostupidfornonflat
140
Architectures: coal abacus
141 142 143 144 145
MD5Sum:
 $(mdandsize source2/x/Sources) Sources
 $(mdandsize source2/x/Packages) Packages
EOF

146
mkdir -p source1/dists/suitename/main/binary-abacus
147 148
mkdir source1/dists/suitename/main/binary-coal
mkdir source1/dists/suitename/main/source
149
mkdir -p source1/dists/suitename/firmware/binary-abacus
150 151
mkdir source1/dists/suitename/firmware/binary-coal
mkdir source1/dists/suitename/firmware/source
152 153 154

cd source1
dpkg-scansources pool/main /dev/null > dists/suitename/main/source/Sources
155
dpkg-scanpackages pool/main /dev/null > dists/suitename/main/binary-abacus/Packages
156 157
dpkg-scanpackages -a coal pool/main /dev/null > dists/suitename/main/binary-coal/Packages
dpkg-scansources pool/firmware /dev/null > dists/suitename/firmware/source/Sources
158
dpkg-scanpackages pool/firmware /dev/null > dists/suitename/firmware/binary-abacus/Packages
159 160
dpkg-scanpackages -a coal pool/firmware /dev/null > dists/suitename/firmware/binary-coal/Packages
cd ..
161

162
cat > source1/dists/suitename/InRelease <<EOF
Bernhard Link's avatar
Bernhard Link committed
163 164
Codename: hohoho
Suite: suitename
165
Architectures: coal abacus
Bernhard Link's avatar
Bernhard Link committed
166
MD5Sum:
167
 00000000000000000000000000000000 0 main/binary-abacus/Packages.lz
168
 00000000000000000000000000000000 0 main/binary-abacus/Packages.gz
169 170 171 172 173
 00000000000000000000000000000000 0 main/binary-coal/Packages.lz
 00000000000000000000000000000000 0 main/source/Sources.lz
 00000000000000000000000000000000 0 firmware/binary-abacus/Packages.lz
 00000000000000000000000000000000 0 firmware/binary-coal/Packages.lz
 00000000000000000000000000000000 0 firmware/source/Sources.lz
Bernhard Link's avatar
Bernhard Link committed
174 175
 00000000000000000000000000000000 0 main/binary-coal/Packages.gz
 00000000000000000000000000000000 0 main/source/Sources.gz
176
 00000000000000000000000000000000 0 firmware/binary-abacus/Packages.gz
Bernhard Link's avatar
Bernhard Link committed
177 178 179 180
 00000000000000000000000000000000 0 firmware/binary-coal/Packages.gz
 00000000000000000000000000000000 0 firmware/source/Sources.gz
EOF

181 182 183
sed -e 's/\.lzma/.lz/' -i  conf/updates

testrun - --lunzip=NONE update boring 3<<EOF
Bernhard Link's avatar
Bernhard Link committed
184
stdout
185
$(odb)
Bernhard Link's avatar
Bernhard Link committed
186 187
-v2*=Created directory "./lists"
stderr
188
*=./conf/updates:5:124: Ignoring all but first 18 entries...
189 190 191 192 193 194 195
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
*=Error: './lists/a_suitename_InRelease' only lists unusable or unrequested compressions of 'main/binary-abacus/Packages'.
196
*=Try e.g the '--lunzip' option (or check what it is set to) to make more useable.
Bernhard Link's avatar
Bernhard Link committed
197 198 199 200 201
*=Or change your DownloadListsAs to request e.g. '.gz'.
-v0*=There have been errors!
returns 255
EOF

202
cat > source1/dists/suitename/InRelease <<EOF
Bernhard Link's avatar
Bernhard Link committed
203 204
Codename: hohoho
Suite: suitename
205
Architectures: coal abacus
Bernhard Link's avatar
Bernhard Link committed
206
MD5Sum:
207 208 209 210 211 212
 00000000000000000000000000000000 0 main/binary-abacus/Packages.lz
 00000000000000000000000000000000 0 main/binary-coal/Packages.lz
 00000000000000000000000000000000 0 main/source/Sources.lz
 00000000000000000000000000000000 0 firmware/binary-abacus/Packages.lz
 00000000000000000000000000000000 0 firmware/binary-coal/Packages.lz
 00000000000000000000000000000000 0 firmware/source/Sources.lz
Bernhard Link's avatar
Bernhard Link committed
213 214
EOF

215
testrun - --lunzip=NONE update boring 3<<EOF
Bernhard Link's avatar
Bernhard Link committed
216
stderr
217
*=./conf/updates:5:124: Ignoring all but first 18 entries...
218 219 220 221 222 223 224
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
*=Error: './lists/a_suitename_InRelease' only lists unusable compressions of 'main/binary-abacus/Packages'.
225
*=Try e.g the '--lunzip' option (or check what it is set to) to make more useable.
Bernhard Link's avatar
Bernhard Link committed
226 227 228 229
-v0*=There have been errors!
returns 255
EOF

230 231
sed -e 's/\.lz\>/.lzma/' -i  conf/updates

232
cat > source1/dists/suitename/InRelease <<EOF
233 234
Codename: hohoho
Suite: suitename
235
Architectures: coal abacus
236
MD5Sum:
237
 $(cd source1 ; md5releaseline suitename main/binary-abacus/Packages)
238 239
 $(cd source1 ; md5releaseline suitename main/binary-coal/Packages)
 $(cd source1 ; md5releaseline suitename main/source/Sources)
240
 $(cd source1 ; md5releaseline suitename firmware/binary-abacus/Packages)
241 242 243 244
 $(cd source1 ; md5releaseline suitename firmware/binary-coal/Packages)
 $(cd source1 ; md5releaseline suitename firmware/source/Sources)
EOF

Bernhard Link's avatar
Bernhard Link committed
245 246
testrun - update boring 3<<EOF
stderr
247
*=./conf/updates:5:126: Ignoring all but first 18 entries...
248 249 250 251 252 253 254
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
*=Error: './lists/a_suitename_InRelease' only lists unrequested compressions of 'main/binary-abacus/Packages'.
Bernhard Link's avatar
Bernhard Link committed
255 256 257 258 259 260 261 262 263 264 265
*=Try changing your DownloadListsAs to request e.g. '.'.
-v0*=There have been errors!
returns 255
EOF

ed -s conf/updates <<EOF
g/.lzma .lzma .lzma .lzma/d
w
q
EOF

266 267
testrun - update boring 3<<EOF
stderr
268
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
269 270
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/Sources'
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/Packages'
271
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
272
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/source/Sources'
273
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/binary-abacus/Packages'
274
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/binary-coal/Packages'
275
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-abacus/Packages'
276
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-coal/Packages'
277
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
278 279
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/Sources'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/Packages'
280
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
281
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/source/Sources'
282
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/binary-abacus/Packages'
283
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/binary-coal/Packages'
284
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-abacus/Packages'
285
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-coal/Packages'
286 287
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
288 289 290 291 292 293 294
stdout
-v0*=Calculating packages to get...
-v3*=  processing updates for 'boring|firmware|source'
# 6 times:
-v5*=  marking everything to be deleted
-v3*=  processing updates for 'boring|firmware|coal'
-v5*=  reading './lists/a_suitename_firmware_coal_Packages'
295 296
-v3*=  processing updates for 'boring|firmware|abacus'
-v5*=  reading './lists/a_suitename_firmware_abacus_Packages'
297 298 299 300 301 302
-v3*=  processing updates for 'boring|main|source'
-v5*=  reading './lists/b_x_Sources'
-v5*=  reading './lists/a_suitename_main_Sources'
-v3*=  processing updates for 'boring|main|coal'
-v5*=  reading './lists/b_x_Packages'
-v5*=  reading './lists/a_suitename_main_coal_Packages'
303
-v3*=  processing updates for 'boring|main|abacus'
304
#-v5*=  reading './lists/b_x_Packages'
305
-v5*=  reading './lists/a_suitename_main_abacus_Packages'
306 307 308 309
-v0*=Getting packages...
stderr
-v6*=aptmethod start 'copy:$WORKDIR/source2/./cc-addons_1-1000_all.deb'
-v6*=aptmethod start 'copy:$WORKDIR/source2/./dd-addons_2-0_all.deb'
310 311
-v6*=aptmethod start 'copy:$WORKDIR/source2/./cc_1-1000_abacus.deb'
-v6*=aptmethod start 'copy:$WORKDIR/source2/./dd_2-0_abacus.deb'
312 313 314 315
-v6*=aptmethod start 'copy:$WORKDIR/source2/./cc_1-1000.tar.gz'
-v6*=aptmethod start 'copy:$WORKDIR/source2/./cc_1-1000.dsc'
-v1*=aptmethod got 'copy:$WORKDIR/source2/./cc-addons_1-1000_all.deb'
-v1*=aptmethod got 'copy:$WORKDIR/source2/./dd-addons_2-0_all.deb'
316 317
-v1*=aptmethod got 'copy:$WORKDIR/source2/./cc_1-1000_abacus.deb'
-v1*=aptmethod got 'copy:$WORKDIR/source2/./dd_2-0_abacus.deb'
318 319
-v1*=aptmethod got 'copy:$WORKDIR/source2/./cc_1-1000.tar.gz'
-v1*=aptmethod got 'copy:$WORKDIR/source2/./cc_1-1000.dsc'
320 321
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa-addons_1-1000_all.deb'
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/bb-addons_2-0_all.deb'
322 323
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_1-1000_abacus.deb'
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/bb_2-0_abacus.deb'
324 325 326 327
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_1-1000.tar.gz'
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_1-1000.dsc'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa-addons_1-1000_all.deb'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/bb-addons_2-0_all.deb'
328 329
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_1-1000_abacus.deb'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/bb_2-0_abacus.deb'
330 331
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_1-1000.tar.gz'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_1-1000.dsc'
332 333 334
stdout
-v2*=Created directory "./pool"
-v2*=Created directory "./pool/firmware"
335 336
-v2*=Created directory "./pool/firmware/b"
-v2*=Created directory "./pool/firmware/b/bb"
337 338 339 340 341
-v2*=Created directory "./pool/firmware/d"
-v2*=Created directory "./pool/firmware/d/dd"
-v2*=Created directory "./pool/main"
-v2*=Created directory "./pool/main/c"
-v2*=Created directory "./pool/main/c/cc"
342 343
-v2*=Created directory "./pool/main/a"
-v2*=Created directory "./pool/main/a/aa"
344 345 346 347 348 349 350 351 352 353 354 355
$(ofa 'pool/firmware/d/dd/dd-addons_2-0_all.deb')
$(ofa 'pool/firmware/d/dd/dd_2-0_abacus.deb')
$(ofa 'pool/main/c/cc/cc-addons_1-1000_all.deb')
$(ofa 'pool/main/c/cc/cc_1-1000_abacus.deb')
$(ofa 'pool/main/c/cc/cc_1-1000.dsc')
$(ofa 'pool/main/c/cc/cc_1-1000.tar.gz')
$(ofa 'pool/firmware/b/bb/bb-addons_2-0_all.deb')
$(ofa 'pool/firmware/b/bb/bb_2-0_abacus.deb')
$(ofa 'pool/main/a/aa/aa-addons_1-1000_all.deb')
$(ofa 'pool/main/a/aa/aa_1-1000_abacus.deb')
$(ofa 'pool/main/a/aa/aa_1-1000.dsc')
$(ofa 'pool/main/a/aa/aa_1-1000.tar.gz')
356 357
-v1*=Shutting down aptmethods...
-v0*=Installing (and possibly deleting) packages...
358 359 360 361 362 363 364 365 366 367 368 369 370 371
$(opa 'dd-addons' x 'boring' 'firmware' 'coal' 'deb')
$(opa 'dd' x 'boring' 'firmware' 'abacus' 'deb')
$(opa 'dd-addons' x 'boring' 'firmware' 'abacus' 'deb')
$(opa 'cc-addons' x 'boring' 'main' 'coal' 'deb')
$(opa 'cc' x 'boring' 'main' 'source' 'dsc')
$(opa 'cc' x 'boring' 'main' 'abacus' 'deb')
$(opa 'cc-addons' x 'boring' 'main' 'abacus' 'deb')
$(opa 'bb-addons' x 'boring' 'firmware' 'coal' 'deb')
$(opa 'bb' x 'boring' 'firmware' 'abacus' 'deb')
$(opa 'bb-addons' x 'boring' 'firmware' 'abacus' 'deb')
$(opa 'aa-addons' x 'boring' 'main' 'coal' 'deb')
$(opa 'aa' x 'boring' 'main' 'source' 'dsc')
$(opa 'aa' x 'boring' 'main' 'abacus' 'deb')
$(opa 'aa-addons' x 'boring' 'main' 'abacus' 'deb')
372 373
EOF

374 375 376 377 378 379 380 381 382 383
DISTRI=dummy PACKAGE=aa EPOCH="" VERSION=2 REVISION=-1 SECTION="base" genpackage.sh -sa
DISTRI=dummy PACKAGE=bb EPOCH="" VERSION=1 REVISION=-1 SECTION="firmware/base" genpackage.sh -sa
DISTRI=dummy PACKAGE=ee EPOCH="" VERSION=2 REVISION=-1 SECTION="firmware/base" genpackage.sh -sa

rm source1/pool/firmware/bb*
mv aa* source1/pool/main
mv ee* bb* source1/pool/firmware

cd source1
dpkg-scansources pool/main /dev/null > dists/suitename/main/source/Sources
384
dpkg-scanpackages pool/main /dev/null > dists/suitename/main/binary-abacus/Packages
385 386
dpkg-scanpackages -a coal pool/main /dev/null > dists/suitename/main/binary-coal/Packages
dpkg-scansources pool/firmware /dev/null > dists/suitename/firmware/source/Sources
387
dpkg-scanpackages pool/firmware /dev/null > dists/suitename/firmware/binary-abacus/Packages
388 389 390
dpkg-scanpackages -a coal pool/firmware /dev/null > dists/suitename/firmware/binary-coal/Packages
cd ..

391
cat > source1/dists/suitename/InRelease <<EOF
392 393
Codename: hohoho
Suite: suitename
394
Architectures: coal abacus
395
MD5Sum:
396
 $(cd source1 ; md5releaseline suitename main/binary-abacus/Packages)
397 398
 $(cd source1 ; md5releaseline suitename main/binary-coal/Packages)
 $(cd source1 ; md5releaseline suitename main/source/Sources)
399
 $(cd source1 ; md5releaseline suitename firmware/binary-abacus/Packages)
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
 $(cd source1 ; md5releaseline suitename firmware/binary-coal/Packages)
 $(cd source1 ; md5releaseline suitename firmware/source/Sources)
EOF

sed -e 's/Update: - 1/Update: 1/' -i conf/distributions
ed -s conf/updates <<EOF
1a
FilterList: upgradeonly
.
w
q
EOF

testrun - --keepunreferenced update boring 3<<EOF
stderr
415 416
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
417
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/source/Sources'
418
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/binary-abacus/Packages'
419
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/main/binary-coal/Packages'
420
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-abacus/Packages'
421
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-coal/Packages'
422 423
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
424
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/source/Sources'
425
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/binary-abacus/Packages'
426
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/main/binary-coal/Packages'
427
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-abacus/Packages'
428
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/firmware/binary-coal/Packages'
429 430
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
431 432 433 434 435
stdout
-v0*=Calculating packages to get...
-v4*=  nothing to do for 'boring|firmware|source'
-v3*=  processing updates for 'boring|firmware|coal'
-v5*=  reading './lists/a_suitename_firmware_coal_Packages'
436 437
-v3*=  processing updates for 'boring|firmware|abacus'
-v5*=  reading './lists/a_suitename_firmware_abacus_Packages'
438 439 440 441 442 443
-v3*=  processing updates for 'boring|main|source'
-v5*=  reading './lists/b_x_Sources'
-v5*=  reading './lists/a_suitename_main_Sources'
-v3*=  processing updates for 'boring|main|coal'
-v5*=  reading './lists/b_x_Packages'
-v5*=  reading './lists/a_suitename_main_coal_Packages'
444
-v3*=  processing updates for 'boring|main|abacus'
445
#-v5*=  reading './lists/b_x_Packages'
446
-v5*=  reading './lists/a_suitename_main_abacus_Packages'
447 448 449
-v0*=Getting packages...
stderr
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa-addons_2-1_all.deb'
450
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_2-1_abacus.deb'
451 452 453
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_2-1.tar.gz'
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/main/aa_2-1.dsc'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa-addons_2-1_all.deb'
454
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_2-1_abacus.deb'
455 456 457
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_2-1.tar.gz'
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/main/aa_2-1.dsc'
stdout
458 459 460 461
$(ofa 'pool/main/a/aa/aa-addons_2-1_all.deb')
$(ofa 'pool/main/a/aa/aa_2-1_abacus.deb')
$(ofa 'pool/main/a/aa/aa_2-1.dsc')
$(ofa 'pool/main/a/aa/aa_2-1.tar.gz')
462 463
-v1*=Shutting down aptmethods...
-v0*=Installing (and possibly deleting) packages...
464 465 466 467
$(opu 'aa-addons' x x 'boring' 'main' 'coal' 'deb')
$(opu 'aa' x x 'boring' 'main' 'source' 'dsc')
$(opu 'aa' x x 'boring' 'main' 'abacus' 'deb')
$(opu 'aa-addons' x x 'boring' 'main' 'abacus' 'deb')
468 469 470 471 472 473 474 475 476 477 478 479 480
-v1*=4 files lost their last reference.
-v1*=(dumpunreferenced lists such files, use deleteunreferenced to delete them.)
EOF

#remove upgradeonly again, letting ee in
ed -s conf/updates <<EOF
%g/FilterList: upgradeonly/d
w
q
EOF

testrun - --keepunreferenced update boring 3<<EOF
stderr
481 482 483 484 485 486
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
487 488 489 490 491 492
stdout
-v0*=Nothing to do found. (Use --noskipold to force processing)
EOF

testrun - --nolistsdownload --keepunreferenced update boring 3<<EOF
stderr
493 494
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
495 496 497 498 499 500
stdout
-v0*=Nothing to do found. (Use --noskipold to force processing)
EOF

testrun - --nolistsdownload --noskipold --keepunreferenced update boring 3<<EOF
stderr
501 502
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
503 504 505 506 507
stdout
-v0*=Calculating packages to get...
-v4*=  nothing to do for 'boring|firmware|source'
-v3*=  processing updates for 'boring|firmware|coal'
-v5*=  reading './lists/a_suitename_firmware_coal_Packages'
508 509
-v3*=  processing updates for 'boring|firmware|abacus'
-v5*=  reading './lists/a_suitename_firmware_abacus_Packages'
510 511 512 513 514 515
-v3*=  processing updates for 'boring|main|source'
-v5*=  reading './lists/b_x_Sources'
-v5*=  reading './lists/a_suitename_main_Sources'
-v3*=  processing updates for 'boring|main|coal'
-v5*=  reading './lists/b_x_Packages'
-v5*=  reading './lists/a_suitename_main_coal_Packages'
516
-v3*=  processing updates for 'boring|main|abacus'
517
#-v5*=  reading './lists/b_x_Packages'
518
-v5*=  reading './lists/a_suitename_main_abacus_Packages'
519 520 521 522 523
-v0*=Getting packages...
-v2*=Created directory "./pool/firmware/e"
-v2*=Created directory "./pool/firmware/e/ee"
stderr
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/ee-addons_2-1_all.deb'
524
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/ee_2-1_abacus.deb'
525
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/ee-addons_2-1_all.deb'
526
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/ee_2-1_abacus.deb'
527
stdout
528 529
$(ofa 'pool/firmware/e/ee/ee-addons_2-1_all.deb')
$(ofa 'pool/firmware/e/ee/ee_2-1_abacus.deb')
530 531
-v1*=Shutting down aptmethods...
-v0*=Installing (and possibly deleting) packages...
532 533 534
$(opa 'ee-addons' x 'boring' 'firmware' 'coal' 'deb')
$(opa 'ee' x 'boring' 'firmware' 'abacus' 'deb')
$(opa 'ee-addons' x 'boring' 'firmware' 'abacus' 'deb')
535 536 537 538 539 540 541 542 543
EOF

#  reinsert delete rule, this should cause a downgrade of bb
sed -e 's/Update: 1/Update: - 1/' -i conf/distributions

# changes to the clean rules causes automatic reprocessing, so new noskipold needed here

testrun - --keepunreferenced update boring 3<<EOF
stderr
544 545 546 547 548 549
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source1/dists/suitename/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source1/dists/suitename/InRelease'
*=WARNING: No signature found in ./lists/a_suitename_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
550 551 552 553 554 555 556
stdout
-v0*=Calculating packages to get...
-v3*=  processing updates for 'boring|firmware|source'
# 6 times:
-v5*=  marking everything to be deleted
-v3*=  processing updates for 'boring|firmware|coal'
-v5*=  reading './lists/a_suitename_firmware_coal_Packages'
557 558
-v3*=  processing updates for 'boring|firmware|abacus'
-v5*=  reading './lists/a_suitename_firmware_abacus_Packages'
559 560 561 562 563 564
-v3*=  processing updates for 'boring|main|source'
-v5*=  reading './lists/b_x_Sources'
-v5*=  reading './lists/a_suitename_main_Sources'
-v3*=  processing updates for 'boring|main|coal'
-v5*=  reading './lists/b_x_Packages'
-v5*=  reading './lists/a_suitename_main_coal_Packages'
565
-v3*=  processing updates for 'boring|main|abacus'
566
#-v5*=  reading './lists/b_x_Packages'
567
-v5*=  reading './lists/a_suitename_main_abacus_Packages'
568 569 570
-v0*=Getting packages...
stderr
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/bb-addons_1-1_all.deb'
571
-v6*=aptmethod start 'copy:$WORKDIR/source1/pool/firmware/bb_1-1_abacus.deb'
572
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/bb-addons_1-1_all.deb'
573
-v1*=aptmethod got 'copy:$WORKDIR/source1/pool/firmware/bb_1-1_abacus.deb'
574
*=Warning: downgrading 'bb-addons' from '2-0' to '1-1' in 'boring|firmware|coal'!
575 576
*=Warning: downgrading 'bb' from '2-0' to '1-1' in 'boring|firmware|abacus'!
*=Warning: downgrading 'bb-addons' from '2-0' to '1-1' in 'boring|firmware|abacus'!
577
stdout
578 579
$(ofa 'pool/firmware/b/bb/bb-addons_1-1_all.deb')
$(ofa 'pool/firmware/b/bb/bb_1-1_abacus.deb')
580 581
-v1*=Shutting down aptmethods...
-v0*=Installing (and possibly deleting) packages...
582 583 584
$(opu 'bb-addons' x x 'boring' 'firmware' 'coal' 'deb')
$(opu 'bb' x x 'boring' 'firmware' 'abacus' 'deb')
$(opu 'bb-addons' x x 'boring' 'firmware' 'abacus' 'deb')
585 586 587 588 589
stdout
-v1*=2 files lost their last reference.
-v1*=(dumpunreferenced lists such files, use deleteunreferenced to delete them.)
EOF

590
#Now it gets evil! Name flat and non-flat the same
591
dodo sed -i -e 's/suitename/x/'  source1/dists/suitename/InRelease
592 593 594
mv source1/dists/suitename source1/dists/x
mv source1/dists source2/dists
dodo sed -i -e 's/suitename/x/' -e 's/^From: a$/From: b/' -e 's/Flat: dummycomponent/#&/' conf/updates
595

596 597
testrun - update boring 3<<EOF
stderr
598
-v0*=Warning: From the same remote repository 'copy:${WORKDIR}/source2', distribution 'x'
599
-v0*=is requested both flat and non-flat. While this is possible
600
-v0*=(having copy:${WORKDIR}/source2/dists/x and copy:${WORKDIR}/source2/x), it is unlikely.
601
-v0*=To no longer see this message, use --ignore=flatandnonflat.
602 603
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/InRelease'
604
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/main/source/Sources'
605
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/main/binary-abacus/Packages'
606
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/main/binary-coal/Packages'
607
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/firmware/binary-abacus/Packages'
608
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/firmware/binary-coal/Packages'
609 610
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/InRelease'
611
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/main/source/Sources'
612
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/main/binary-abacus/Packages'
613
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/main/binary-coal/Packages'
614
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/firmware/binary-abacus/Packages'
615
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/firmware/binary-coal/Packages'
616 617
*=WARNING: No signature found in ./lists/b_x_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
618 619 620 621 622 623 624
stdout
-v0*=Calculating packages to get...
-v0*=  nothing new for 'boring|firmware|source' (use --noskipold to process anyway)
-v3*=  processing updates for 'boring|firmware|coal'
# 5 times:
-v5*=  marking everything to be deleted
-v5*=  reading './lists/b_x_firmware_coal_Packages'
625 626
-v3*=  processing updates for 'boring|firmware|abacus'
-v5*=  reading './lists/b_x_firmware_abacus_Packages'
627 628 629 630 631 632
-v3*=  processing updates for 'boring|main|source'
-v5*=  reading './lists/b_x_Sources'
-v5*=  reading './lists/b_x_main_Sources'
-v3*=  processing updates for 'boring|main|coal'
-v5*=  reading './lists/b_x_Packages'
-v5*=  reading './lists/b_x_main_coal_Packages'
633
-v3*=  processing updates for 'boring|main|abacus'
634
#-v5*=  reading './lists/b_x_Packages'
635
-v5*=  reading './lists/b_x_main_abacus_Packages'
636 637 638 639 640
stderr
EOF

testrun - --ignore=flatandnonflat update boring 3<<EOF
stderr
641 642 643 644 645 646
-v6*=aptmethod start 'copy:$WORKDIR/source2/x/InRelease'
-v6*=aptmethod start 'copy:$WORKDIR/source2/dists/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/x/InRelease'
-v1*=aptmethod got 'copy:$WORKDIR/source2/dists/x/InRelease'
*=WARNING: No signature found in ./lists/b_x_InRelease, assuming it is unsigned!
*=WARNING: No signature found in ./lists/b_x_flat_InRelease, assuming it is unsigned!
647 648 649 650 651
stdout
-v0*=Nothing to do found. (Use --noskipold to force processing)
stderr
EOF

652 653 654
cat > results.expected <<EOF
add boring deb firmware coal bb-addons 2-0 -- pool/firmware/b/bb/bb-addons_2-0_all.deb
add boring deb firmware coal dd-addons 2-0 -- pool/firmware/d/dd/dd-addons_2-0_all.deb
655 656 657 658
add boring deb firmware abacus bb 2-0 -- pool/firmware/b/bb/bb_2-0_abacus.deb
add boring deb firmware abacus bb-addons 2-0 -- pool/firmware/b/bb/bb-addons_2-0_all.deb
add boring deb firmware abacus dd 2-0 -- pool/firmware/d/dd/dd_2-0_abacus.deb
add boring deb firmware abacus dd-addons 2-0 -- pool/firmware/d/dd/dd-addons_2-0_all.deb
659 660 661 662
add boring dsc main source aa 1-1000 -- pool/main/a/aa/aa_1-1000.dsc pool/main/a/aa/aa_1-1000.tar.gz
add boring dsc main source cc 1-1000 -- pool/main/c/cc/cc_1-1000.dsc pool/main/c/cc/cc_1-1000.tar.gz
add boring deb main coal aa-addons 1-1000 -- pool/main/a/aa/aa-addons_1-1000_all.deb
add boring deb main coal cc-addons 1-1000 -- pool/main/c/cc/cc-addons_1-1000_all.deb
663 664 665 666
add boring deb main abacus aa 1-1000 -- pool/main/a/aa/aa_1-1000_abacus.deb
add boring deb main abacus aa-addons 1-1000 -- pool/main/a/aa/aa-addons_1-1000_all.deb
add boring deb main abacus cc 1-1000 -- pool/main/c/cc/cc_1-1000_abacus.deb
add boring deb main abacus cc-addons 1-1000 -- pool/main/c/cc/cc-addons_1-1000_all.deb
667 668
replace boring dsc main source aa 2-1 1-1000 -- pool/main/a/aa/aa_2-1.dsc pool/main/a/aa/aa_2-1.tar.gz -- pool/main/a/aa/aa_1-1000.dsc pool/main/a/aa/aa_1-1000.tar.gz
replace boring deb main coal aa-addons 2-1 1-1000 -- pool/main/a/aa/aa-addons_2-1_all.deb -- pool/main/a/aa/aa-addons_1-1000_all.deb
669 670
replace boring deb main abacus aa 2-1 1-1000 -- pool/main/a/aa/aa_2-1_abacus.deb -- pool/main/a/aa/aa_1-1000_abacus.deb
replace boring deb main abacus aa-addons 2-1 1-1000 -- pool/main/a/aa/aa-addons_2-1_all.deb -- pool/main/a/aa/aa-addons_1-1000_all.deb
671
add boring deb firmware coal ee-addons 2-1 -- pool/firmware/e/ee/ee-addons_2-1_all.deb
672 673
add boring deb firmware abacus ee 2-1 -- pool/firmware/e/ee/ee_2-1_abacus.deb
add boring deb firmware abacus ee-addons 2-1 -- pool/firmware/e/ee/ee-addons_2-1_all.deb
674
replace boring deb firmware coal bb-addons 1-1 2-0 -- pool/firmware/b/bb/bb-addons_1-1_all.deb -- pool/firmware/b/bb/bb-addons_2-0_all.deb
675 676
replace boring deb firmware abacus bb 1-1 2-0 -- pool/firmware/b/bb/bb_1-1_abacus.deb -- pool/firmware/b/bb/bb_2-0_abacus.deb
replace boring deb firmware abacus bb-addons 1-1 2-0 -- pool/firmware/b/bb/bb-addons_1-1_all.deb -- pool/firmware/b/bb/bb-addons_2-0_all.deb
677 678 679 680 681
EOF

dodo test ! -f shouldnothappen
dodiff results.expected updatelog
rm updatelog results.expected
682
rm -r -f db conf dists pool lists source1 source2 test.changes
683
testsuccess