]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-611729-mark-as-manual
run update post-invokes even on (partial) failures
[apt.git] / test / integration / test-bug-611729-mark-as-manual
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture "i386"
8
9 buildsimplenativepackage "peace-dpkg" "all" "1.0" "stable"
10
11 buildsimplenativepackage "a" "all" "1.0" "stable" "Depends: b"
12 buildsimplenativepackage "b" "all" "1.0" "stable"
13 buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b"
14
15 setupaptarchive
16
17 # dpkg freaks out if the last package is removed so keep one around
18 testsuccess aptget install peace-dpkg -y
19 testdpkginstalled peace-dpkg
20 testmarkedauto
21
22 testsuccess aptget install a -y
23 testdpkginstalled a b
24 testdpkgnotinstalled c
25 testmarkedauto 'b'
26
27 testsuccess aptget remove a -y
28 testdpkgnotinstalled a c
29 testdpkginstalled b
30 testmarkedauto 'b'
31
32 testsuccess aptget install c -y
33 testdpkgnotinstalled a
34 testdpkginstalled b c
35 testmarkedauto 'b'
36
37 testsuccessequal 'Reading package lists...
38 Building dependency tree...
39 Reading state information...
40 b is already the newest version (1.0).
41 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade
42 testmarkedauto 'b'
43
44 testsuccessequal 'Reading package lists...
45 Building dependency tree...
46 Reading state information...
47 b is already the newest version (1.0).
48 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d
49 testmarkedauto 'b'
50
51 rm rootdir/var/log/apt/history.log
52
53 testsuccess aptget install b --reinstall -y
54 testdpkgnotinstalled a
55 testdpkginstalled b c
56 testmarkedauto 'b'
57
58 sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
59 if [ -n "$SUDO_USER" ]; then
60 testfileequal 'rootdir/var/log/apt/history.log' "
61 Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
62 Reinstall: b:i386 (1.0)"
63 else
64 testfileequal 'rootdir/var/log/apt/history.log' '
65 Reinstall: b:i386 (1.0)'
66 fi
67
68 testsuccessequal 'Reading package lists...
69 Building dependency tree...
70 Reading state information...
71 b is already the newest version (1.0).
72 b set to manually installed.
73 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b
74 testmarkedauto
75
76 testsuccess aptget remove b -y
77 testdpkgnotinstalled a b c
78 testmarkedauto
79
80 testsuccess aptget install a b -y
81 testdpkginstalled a b
82 testdpkgnotinstalled c
83 testmarkedauto
84
85 testsuccess aptget purge a b -y
86 testdpkgnotinstalled a b c
87 testmarkedauto
88
89 testsuccess aptget install b c -y
90 testdpkgnotinstalled a
91 testdpkginstalled b c
92 testmarkedauto
93
94 testsuccess aptget install a -y
95 testdpkginstalled a b c
96 testmarkedauto