]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-never-markauto-sections
mark again deps of pkgs in APT::Never-MarkAuto-Sections as manual
[apt.git] / test / integration / test-apt-never-markauto-sections
CommitLineData
3cbeed98
DK
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
12# this is a very crude regression test, not a "this is how it should be" test:
13# In theory mydesktop-core and texteditor should be marked as manual, but
14# texteditor is installed as a dependency of bad-texteditor, not of
15# mydesktop-core and mydesktop-core is removed while bad-texteditor is
16# installed losing the manual bit as the problem resolver will later decide to
17# drop bad-texteditor and re-instate mydesktop-core which is considered an
18# auto-install at that point (in theory the never-auto handling should be
19# copied to this place – as to the many other places dependencies are resolved
20# 'by hand' instead of via MarkInstall AutoInst…
21#
22# Both could be fixed if apt would figure out early that installing
23# bad-texteditor is a bad idea and eventually it should (as mydesktop-core is
24# a direct descendant of mydesktop which was a user-request mydesktop-core should
25# be as protected from removal as mydesktop is), but this is hard in the general case
26# as with more or-groups and provides you can produce 'legal' examples for this.
27
28buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg
29Recommends: notavailable' '' 'metapackages'
30buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg
31Recommends: notavailable
32Multi-Arch: foreign' '' 'metapackages'
33buildsimplenativepackage 'browser' 'amd64' '41' 'stable'
34buildsimplenativepackage 'browser' 'amd64' '42' 'unstable'
35buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable'
36buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor
37Conflicts: mydesktop-core'
38buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '<none>'
39buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign'
40setupaptarchive
41
42testsuccess aptcache show nosection
43testfailure grep 'Section' rootdir/tmp/testsuccess.output
44testequal 'dpkg' aptmark showmanual
45
46testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
47
48testequal 'browser
49dpkg
50foreignpkg:i386
51mydesktop
52nosection' aptmark showmanual
53testmarkedauto 'mydesktop-core' 'texteditor'
54
55testequal 'Reading package lists...
56Building dependency tree...
57Reading state information...
58The following packages will be REMOVED:
59 mydesktop mydesktop-core texteditor
600 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
61Remv mydesktop [1]
62Remv mydesktop-core [1]
63Remv texteditor [1]' aptget autoremove mydesktop -s
64
65testequal 'Reading package lists...
66Building dependency tree...
67Reading state information...
68The following packages will be REMOVED:
69 mydesktop mydesktop-core texteditor
700 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
71Remv mydesktop [1]
72Remv mydesktop-core [1]
73Remv texteditor [1]' aptget autoremove texteditor -s
74testsuccess aptget autoremove texteditor -y
75
76testdpkgnotinstalled mydesktop mydesktop-core texteditor
77testdpkginstalled browser
78
79testequal 'browser
80dpkg
81foreignpkg:i386
82nosection' aptmark showmanual
83testmarkedauto
84
85# test that installed/upgraded auto-pkgs are not set to manual
86
87testsuccess aptget install browser=41 -y --force-yes
88
89testequal 'browser
90dpkg
91foreignpkg:i386
92nosection' aptmark showmanual
93testmarkedauto
94testsuccess aptmark auto browser
95testmarkedauto 'browser'
96testsuccess aptmark auto nosection
97testmarkedauto 'browser' 'nosection'
98testequal 'dpkg
99foreignpkg:i386' aptmark showmanual
100
101testsuccess aptget install mydesktop -y
102
103testequal 'dpkg
104foreignpkg:i386
105mydesktop' aptmark showmanual
106testmarkedauto 'browser' 'nosection' 'mydesktop-core' 'texteditor'