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