]>
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 |
ea65d079 | 7 | configarchitecture 'native' |
75954ae2 | 8 | |
63c71412 DK |
9 | buildsimplenativepackage 'old-pkg' 'native' '1.0' 'stable' |
10 | buildsimplenativepackage 'unrelated' 'all' '0.5' 'unstable' | |
75954ae2 | 11 | |
63c71412 | 12 | setupsimplenativepackage 'new-pkg' 'native' '2.0' 'unstable' 'Provides: old-pkg |
75954ae2 | 13 | Replaces: old-pkg |
63c71412 DK |
14 | Conflicts: old-pkg (<< 2.0)' |
15 | BUILDDIR='incoming/new-pkg-2.0' | |
16 | echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/new-pkg.links" | |
17 | buildpackage "$BUILDDIR" 'unstable' 'main' | |
75954ae2 DK |
18 | rm -rf "$BUILDDIR" |
19 | ||
63c71412 DK |
20 | setupsimplenativepackage 'old-pkg' 'all' '2.0' 'unstable' 'Depends: new-pkg' |
21 | BUILDDIR='incoming/old-pkg-2.0' | |
22 | echo '/usr/share/doc/new-pkg /usr/share/doc/old-pkg' > "${BUILDDIR}/debian/old-pkg.links" | |
75954ae2 DK |
23 | echo " |
24 | override_dh_link: | |
25 | rm -rf debian/old-pkg/usr/share/doc/old-pkg/ | |
63c71412 DK |
26 | dh_link" >> "${BUILDDIR}/debian/rules" |
27 | buildpackage "$BUILDDIR" 'unstable' 'main' | |
75954ae2 DK |
28 | rm -rf "$BUILDDIR" |
29 | ||
30 | setupaptarchive | |
31 | ||
0440d936 | 32 | testsuccess aptget install old-pkg=1.0 --trivial-only |
75954ae2 | 33 | |
ec7f904e | 34 | testmarkedauto # old-pkg is manual installed |
75954ae2 | 35 | |
87d6947d | 36 | CMD='aptget dist-upgrade -y' |
63c71412 DK |
37 | msgtest 'Test for equality of' "$CMD" |
38 | COMPAREFILE="$(mktemp)" | |
39 | echo 'The following package disappeared from your system as | |
75954ae2 DK |
40 | all files have been overwritten by other packages: |
41 | old-pkg | |
63c71412 DK |
42 | Note: This is done automatically and on purpose by dpkg.' > "$COMPAREFILE" |
43 | $CMD 2>&1 | tail -n 4 | diff -u "$COMPAREFILE" - && msgpass || msgfail | |
44 | rm "$COMPAREFILE" | |
75954ae2 | 45 | |
ea65d079 | 46 | 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 |
47 | if [ -n "$SUDO_USER" ]; then |
48 | testfileequal 'rootdir/var/log/apt/history.log' " | |
49 | Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) | |
50 | Install: old-pkg:native (1.0) | |
51 | ||
52 | Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) | |
53 | Install: new-pkg:native (2.0, automatic) | |
54 | Upgrade: old-pkg:native (1.0, 2.0) | |
55 | Disappeared: old-pkg (1.0)" | |
56 | else | |
57 | testfileequal 'rootdir/var/log/apt/history.log' ' | |
ea65d079 | 58 | Install: old-pkg:native (1.0) |
75954ae2 | 59 | |
ea65d079 DK |
60 | Install: new-pkg:native (2.0, automatic) |
61 | Upgrade: old-pkg:native (1.0, 2.0) | |
63c71412 | 62 | Disappeared: old-pkg (1.0)' |
0479205d | 63 | fi |
75954ae2 | 64 | |
ec7f904e | 65 | testmarkedauto # new-pkg should have get the manual flag from old-pkg |