4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64' 'i386'
9 buildsimplenativepackage 'old-pkg' 'amd64' '1' 'stable'
11 setupsimplenativepackage 'new-pkg' 'amd64' '2' 'unstable' 'Provides: old-pkg
13 Conflicts: old-pkg (<< 2)'
14 BUILDDIR='incoming/new-pkg-2'
15 echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian
/new
-pkg.links
"
16 buildpackage "$BUILDDIR" 'unstable' 'main'
19 setupsimplenativepackage 'old-pkg' 'all' '2' 'unstable' 'Depends: new-pkg'
20 BUILDDIR='incoming/old-pkg-2'
21 echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian
/old
-pkg.links
"
24 rm -rf debian
/old
-pkg/usr
/share
/doc
/old
-pkg/
25 dh_link
" >> "${BUILDDIR}/debian
/rules
"
26 buildpackage "$BUILDDIR" 'unstable' 'main'
29 setupsimplenativepackage 'super-new-pkg' 'i386' '3' 'experimental' 'Provides: 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'
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
"
44 rm -rf debian
/new
-pkg/usr
/share
/doc
/new
-pkg/
45 dh_link
" >> "${BUILDDIR}/debian
/rules
"
46 buildpackage "$BUILDDIR" 'experimental' 'main'
51 msgmsg 'Let a package disappear' 'old-pkg'
52 testsuccess aptget install old-pkg=1 --trivial-only
53 testmarkedauto # old-pkg is manual installed
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
58 all files have been overwritten by other packages:
60 Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output
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 #"
63 if [ -n "$SUDO_USER" ]; then
64 testfileequal
'rootdir/var/log/apt/history.log' "
65 Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
66 Install: old-pkg:native (1)
68 Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
69 Install: new-pkg:native (2, automatic)
70 Upgrade: old-pkg:native (1, 2)
71 Disappeared: old-pkg (1)"
73 testfileequal
'rootdir/var/log/apt/history.log' '
74 Install: old-pkg:native (1)
76 Install: new-pkg:native (2, automatic)
77 Upgrade: old-pkg:native (1, 2)
78 Disappeared: old-pkg (1)'
81 testmarkedauto
# new-pkg should have get the manual flag from old-pkg
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:
90 Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output