File: test-apt-never-markauto-sections

package info (click to toggle)
apt 3.1.13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,764 kB
  • sloc: cpp: 71,085; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (96 lines) | stat: -rwxr-xr-x 4,200 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64' 'i386'

aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections
testsuccess grep '^metapackages$' nevermarkauto.sections
testfailure grep '^universe/metapackages$' nevermarkauto.sections

buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg
Recommends: notavailable' '' 'metapackages'
buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg
Recommends: notavailable
Multi-Arch: foreign' '' 'universe/metapackages'
buildsimplenativepackage 'browser' 'amd64' '41' 'stable'
buildsimplenativepackage 'browser' 'amd64' '42' 'unstable'
buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable'
buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor
Conflicts: mydesktop-core'
buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign'
setupaptarchive

insertinstalledpackage 'nosection' 'amd64' '1' '' '' '' '' '<none>'

testsuccess aptmark auto nosection
testempty aptmark showmanual
testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1

testsuccess aptcache show nosection
testfailure grep 'Section' rootdir/tmp/testsuccess.output

testmarkedmanual 'mydesktop'
testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection'

# if the remove is from a user, don't do manual-bit passing
testequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  browser foreignpkg:i386 mydesktop mydesktop-core nosection texteditor
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
Remv mydesktop [1]
Remv mydesktop-core [1]
Remv browser [42]
Remv foreignpkg:i386 [1]
Remv nosection [1]
Remv texteditor [1]' aptget autoremove mydesktop -s

testfailuremsg 'E: Unable to satisfy dependencies. Reached two conflicting assignments:
   1. bad-texteditor:amd64 is selected for install because:
      1. mydesktop:amd64 is selected for install
      2. mydesktop:amd64 Depends mydesktop-core
      3. mydesktop-core:amd64 Depends bad-texteditor | texteditor
         [selected mydesktop-core:amd64]
      For context, additional choices that could not be installed:
      * In mydesktop-core:amd64 Depends bad-texteditor | texteditor:
        - texteditor:amd64 is selected for removal
   2. bad-texteditor:amd64 Depends texteditor
      but none of the choices are installable:
      - texteditor:amd64 is selected for removal' aptget autoremove texteditor -s --solver 3.0 -o APT::Solver::RemoveManual=0 #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  mydesktop mydesktop-core texteditor
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Remv mydesktop [1]
Remv mydesktop-core [1]
Remv texteditor [1]' aptget autoremove texteditor -s  #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
testsuccess aptget autoremove texteditor -y --solver internal

testdpkgnotinstalled mydesktop mydesktop-core texteditor
testdpkginstalled browser

testmarkedmanual 'browser' 'foreignpkg:i386' 'nosection'
testmarkedauto

# test that installed/upgraded auto-pkgs are not set to manual

testsuccess aptget install browser=41 -y --allow-downgrades

testmarkedmanual 'browser' 'foreignpkg:i386' 'nosection'
testmarkedauto
testsuccess aptmark auto browser
testmarkedauto 'browser'
testsuccess aptmark auto nosection
testmarkedauto 'browser' 'nosection'
testmarkedmanual 'foreignpkg:i386'

testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1

testmarkedmanual 'foreignpkg:i386' 'mydesktop'
testmarkedauto 'browser' 'mydesktop-core' 'texteditor' 'nosection'