4 TESTDIR
=$(readlink -f $(dirname $0))
7 configarchitecture
'amd64' 'i386'
9 aptconfig dump
--no-empty --format '%v%n' APT
::Never
-MarkAuto-Sections > nevermarkauto.sections
10 testsuccess
grep '^metapackages$' nevermarkauto.sections
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…
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.
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'
42 testsuccess aptcache show nosection
43 testfailure
grep 'Section' rootdir
/tmp
/testsuccess.output
44 testequal
'dpkg' aptmark showmanual
46 testsuccess aptget
install mydesktop
-y -o Debug
::pkgProblemResolver
=1 -o Debug
::pkgDepCache
::Marker
=1
52 nosection' aptmark showmanual
53 testmarkedauto
'mydesktop-core' 'texteditor'
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.
62 Remv mydesktop-core [1]
63 Remv texteditor [1]' aptget autoremove mydesktop
-s
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.
72 Remv mydesktop-core [1]
73 Remv texteditor [1]' aptget autoremove texteditor
-s
74 testsuccess aptget autoremove texteditor
-y
76 testdpkgnotinstalled mydesktop mydesktop
-core texteditor
77 testdpkginstalled browser
82 nosection' aptmark showmanual
85 # test that installed/upgraded auto-pkgs are not set to manual
87 testsuccess aptget
install browser
=41 -y --force-yes
92 nosection' aptmark showmanual
94 testsuccess aptmark auto browser
95 testmarkedauto
'browser'
96 testsuccess aptmark auto nosection
97 testmarkedauto
'browser' 'nosection'
99 foreignpkg:i386' aptmark showmanual
101 testsuccess aptget
install mydesktop
-y
105 mydesktop' aptmark showmanual
106 testmarkedauto
'browser' 'nosection' 'mydesktop-core' 'texteditor'