]>
Commit | Line | Data |
---|---|---|
75954ae2 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
63c71412 DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
75954ae2 | 6 | setupenvironment |
dabe9e24 | 7 | configarchitecture 'amd64' 'i386' |
75954ae2 | 8 | |
dabe9e24 | 9 | buildsimplenativepackage 'old-pkg' 'amd64' '1' 'stable' |
75954ae2 | 10 | |
dabe9e24 | 11 | setupsimplenativepackage 'new-pkg' 'amd64' '2' 'unstable' 'Provides: old-pkg |
75954ae2 | 12 | Replaces: old-pkg |
dabe9e24 DK |
13 | Conflicts: old-pkg (<< 2)' |
14 | BUILDDIR='incoming/new-pkg-2' | |
63c71412 DK |
15 | echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/new-pkg.links" |
16 | buildpackage "$BUILDDIR" 'unstable' 'main' | |
75954ae2 DK |
17 | rm -rf "$BUILDDIR" |
18 | ||
dabe9e24 DK |
19 | setupsimplenativepackage 'old-pkg' 'all' '2' 'unstable' 'Depends: new-pkg' |
20 | BUILDDIR='incoming/old-pkg-2' | |
63c71412 | 21 | echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/old-pkg.links" |
75954ae2 DK |
22 | echo " |
23 | override_dh_link: | |
24 | rm -rf debian/old-pkg/usr/share/doc/old-pkg/ | |
63c71412 DK |
25 | dh_link" >> "${BUILDDIR}/debian/rules" |
26 | buildpackage "$BUILDDIR" 'unstable' 'main' | |
75954ae2 DK |
27 | rm -rf "$BUILDDIR" |
28 | ||
dabe9e24 DK |
29 | setupsimplenativepackage 'super-new-pkg' 'i386' '3' 'experimental' 'Provides: new-pkg |
30 | Replaces: new-pkg | |
31 | Conflicts: new-pkg (<< 3)' | |
32 | BUILDDIR='incoming/super-new-pkg-3' | |
33 | echo '/usr/share/doc/super-new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/super-new-pkg.links" | |
34 | echo '/usr/share/doc/super-new-pkg /usr/share/doc/new-pkg' >> "${BUILDDIR}/debian/super-new-pkg.links" | |
35 | buildpackage "$BUILDDIR" 'experimental' 'main' | |
36 | rm -rf "$BUILDDIR" | |
37 | ||
38 | setupsimplenativepackage 'new-pkg' 'all' '3' 'experimental' 'Depends: super-new-pkg' | |
39 | BUILDDIR='incoming/new-pkg-3' | |
40 | echo '/usr/share/doc/super-new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/new-pkg.links" | |
41 | echo '/usr/share/doc/super-new-pkg /usr/share/doc/new-pkg' >> "${BUILDDIR}/debian/new-pkg.links" | |
42 | echo " | |
43 | override_dh_link: | |
44 | rm -rf debian/new-pkg/usr/share/doc/new-pkg/ | |
45 | dh_link" >> "${BUILDDIR}/debian/rules" | |
46 | buildpackage "$BUILDDIR" 'experimental' 'main' | |
47 | rm -rf "$BUILDDIR" | |
75954ae2 | 48 | |
dabe9e24 | 49 | setupaptarchive |
75954ae2 | 50 | |
dabe9e24 DK |
51 | msgmsg 'Let a package disappear' 'old-pkg' |
52 | testsuccess aptget install old-pkg=1 --trivial-only | |
ec7f904e | 53 | testmarkedauto # old-pkg is manual installed |
dabe9e24 DK |
54 | testsuccess aptget dist-upgrade -y |
55 | testdpkgnotinstalled old-pkg | |
56 | cp rootdir/tmp/testsuccess.output disappear.output | |
57 | testsuccessequal 'The following package disappeared from your system as | |
75954ae2 DK |
58 | all files have been overwritten by other packages: |
59 | old-pkg | |
dabe9e24 | 60 | Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output |
75954ae2 | 61 | |
ea65d079 | 62 | sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e "s#:$(getarchitecture 'native') #:native #" |
0479205d DK |
63 | if [ -n "$SUDO_USER" ]; then |
64 | testfileequal 'rootdir/var/log/apt/history.log' " | |
65 | Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) | |
dabe9e24 | 66 | Install: old-pkg:native (1) |
0479205d DK |
67 | |
68 | Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) | |
dabe9e24 DK |
69 | Install: new-pkg:native (2, automatic) |
70 | Upgrade: old-pkg:native (1, 2) | |
71 | Disappeared: old-pkg (1)" | |
0479205d DK |
72 | else |
73 | testfileequal 'rootdir/var/log/apt/history.log' ' | |
dabe9e24 | 74 | Install: old-pkg:native (1) |
75954ae2 | 75 | |
dabe9e24 DK |
76 | Install: new-pkg:native (2, automatic) |
77 | Upgrade: old-pkg:native (1, 2) | |
78 | Disappeared: old-pkg (1)' | |
0479205d | 79 | fi |
75954ae2 | 80 | |
ec7f904e | 81 | testmarkedauto # new-pkg should have get the manual flag from old-pkg |
dabe9e24 DK |
82 | |
83 | msgmsg 'Let a package disappear which let the previous disappear' 'new-pkg' | |
84 | testsuccess aptget dist-upgrade -y -t experimental | |
85 | testdpkgnotinstalled new-pkg | |
86 | cp rootdir/tmp/testsuccess.output disappear.output | |
87 | testsuccessequal 'The following package disappeared from your system as | |
88 | all files have been overwritten by other packages: | |
89 | new-pkg | |
90 | Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output | |
91 | ||
92 | testmarkedauto |