]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-never-markauto-sections
acquire: Use priority queues and a 3 stage pipeline design
[apt.git] / test / integration / test-apt-never-markauto-sections
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections
10testsuccess grep '^metapackages$' nevermarkauto.sections
11
12buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg
13Recommends: notavailable' '' 'metapackages'
14buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg
15Recommends: notavailable
16Multi-Arch: foreign' '' 'metapackages'
17buildsimplenativepackage 'browser' 'amd64' '41' 'stable'
18buildsimplenativepackage 'browser' 'amd64' '42' 'unstable'
19buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable'
20buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor
21Conflicts: mydesktop-core'
22buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '<none>'
23buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign'
24setupaptarchive
25
26testsuccess aptcache show nosection
27testfailure grep 'Section' rootdir/tmp/testsuccess.output
28testequal 'dpkg' aptmark showmanual
29
30testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
31
32testmarkedmanual 'dpkg' 'mydesktop'
33testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection'
34
35# if the remove is from a user, don't do manual-bit passing
36testequal 'Reading package lists...
37Building dependency tree...
38Reading state information...
39The following packages will be REMOVED:
40 browser foreignpkg:i386 mydesktop mydesktop-core nosection texteditor
410 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
42Remv mydesktop [1]
43Remv mydesktop-core [1]
44Remv browser [42]
45Remv foreignpkg:i386 [1]
46Remv nosection [1]
47Remv texteditor [1]' aptget autoremove mydesktop -s
48
49testequal 'Reading package lists...
50Building dependency tree...
51Reading state information...
52The following packages will be REMOVED:
53 mydesktop mydesktop-core texteditor
540 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
55Remv mydesktop [1]
56Remv mydesktop-core [1]
57Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
58testsuccess aptget autoremove texteditor -y
59
60testdpkgnotinstalled mydesktop mydesktop-core texteditor
61testdpkginstalled browser
62
63testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
64testmarkedauto
65
66# test that installed/upgraded auto-pkgs are not set to manual
67
68testsuccess aptget install browser=41 -y --allow-downgrades
69
70testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
71testmarkedauto
72testsuccess aptmark auto browser
73testmarkedauto 'browser'
74testsuccess aptmark auto nosection
75testmarkedauto 'browser' 'nosection'
76testmarkedmanual 'dpkg' 'foreignpkg:i386'
77
78# nosection should be auto, not manual, but is marked as such by the resolver
79# removing mydesktop-core temporally… the resolver should be figuring out here
80# that there is no point of removing mydesktop-core as its an unavoidable
81# dependency of the user-requested mydesktop
82
83testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
84
85testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' 'nosection'
86testmarkedauto 'browser' 'mydesktop-core' 'texteditor'