]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-never-markauto-sections
support "install ./foo.changes"
[apt.git] / test / integration / test-apt-never-markauto-sections
CommitLineData
3cbeed98
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
3cbeed98
DK
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections
10testsuccess grep '^metapackages$' nevermarkauto.sections
11
3cbeed98
DK
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
7c2cc4a7
DK
32testmarkedmanual 'dpkg' 'mydesktop'
33testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection'
3cbeed98 34
7c2cc4a7 35# if the remove is from a user, don't do manual-bit passing
3cbeed98
DK
36testequal 'Reading package lists...
37Building dependency tree...
38Reading state information...
39The following packages will be REMOVED:
7c2cc4a7
DK
40 browser foreignpkg:i386 mydesktop mydesktop-core nosection texteditor
410 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
3cbeed98
DK
42Remv mydesktop [1]
43Remv mydesktop-core [1]
7c2cc4a7
DK
44Remv browser [42]
45Remv foreignpkg:i386 [1]
46Remv nosection [1]
3cbeed98
DK
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]
7c2cc4a7 57Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
3cbeed98
DK
58testsuccess aptget autoremove texteditor -y
59
60testdpkgnotinstalled mydesktop mydesktop-core texteditor
61testdpkginstalled browser
62
7c2cc4a7 63testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
3cbeed98
DK
64testmarkedauto
65
66# test that installed/upgraded auto-pkgs are not set to manual
67
b381a482 68testsuccess aptget install browser=41 -y --allow-downgrades
3cbeed98 69
7c2cc4a7 70testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
3cbeed98
DK
71testmarkedauto
72testsuccess aptmark auto browser
73testmarkedauto 'browser'
74testsuccess aptmark auto nosection
75testmarkedauto 'browser' 'nosection'
7c2cc4a7
DK
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
3cbeed98 82
7c2cc4a7 83testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
3cbeed98 84
7c2cc4a7
DK
85testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' 'nosection'
86testmarkedauto 'browser' 'mydesktop-core' 'texteditor'