]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-never-markauto-sections
change to libapt-pkg abi 5.0 with versioned symbols
[apt.git] / test / integration / test-apt-never-markauto-sections
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'amd64' 'i386'
8
9 aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections
10 testsuccess 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
28 buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg
29 Recommends: notavailable' '' 'metapackages'
30 buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg
31 Recommends: notavailable
32 Multi-Arch: foreign' '' 'metapackages'
33 buildsimplenativepackage 'browser' 'amd64' '41' 'stable'
34 buildsimplenativepackage 'browser' 'amd64' '42' 'unstable'
35 buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable'
36 buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor
37 Conflicts: mydesktop-core'
38 buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '<none>'
39 buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign'
40 setupaptarchive
41
42 testsuccess aptcache show nosection
43 testfailure grep 'Section' rootdir/tmp/testsuccess.output
44 testequal 'dpkg' aptmark showmanual
45
46 testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
47
48 testequal 'browser
49 dpkg
50 foreignpkg:i386
51 mydesktop
52 nosection' aptmark showmanual
53 testmarkedauto 'mydesktop-core' 'texteditor'
54
55 testequal 'Reading package lists...
56 Building dependency tree...
57 Reading state information...
58 The following packages will be REMOVED:
59 mydesktop mydesktop-core texteditor
60 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
61 Remv mydesktop [1]
62 Remv mydesktop-core [1]
63 Remv texteditor [1]' aptget autoremove mydesktop -s
64
65 testequal 'Reading package lists...
66 Building dependency tree...
67 Reading state information...
68 The following packages will be REMOVED:
69 mydesktop mydesktop-core texteditor
70 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
71 Remv mydesktop [1]
72 Remv mydesktop-core [1]
73 Remv texteditor [1]' aptget autoremove texteditor -s
74 testsuccess aptget autoremove texteditor -y
75
76 testdpkgnotinstalled mydesktop mydesktop-core texteditor
77 testdpkginstalled browser
78
79 testequal 'browser
80 dpkg
81 foreignpkg:i386
82 nosection' aptmark showmanual
83 testmarkedauto
84
85 # test that installed/upgraded auto-pkgs are not set to manual
86
87 testsuccess aptget install browser=41 -y --force-yes
88
89 testequal 'browser
90 dpkg
91 foreignpkg:i386
92 nosection' aptmark showmanual
93 testmarkedauto
94 testsuccess aptmark auto browser
95 testmarkedauto 'browser'
96 testsuccess aptmark auto nosection
97 testmarkedauto 'browser' 'nosection'
98 testequal 'dpkg
99 foreignpkg:i386' aptmark showmanual
100
101 testsuccess aptget install mydesktop -y
102
103 testequal 'dpkg
104 foreignpkg:i386
105 mydesktop' aptmark showmanual
106 testmarkedauto 'browser' 'nosection' 'mydesktop-core' 'texteditor'