summaryrefslogtreecommitdiffstats
path: root/test/integration/test-resolver-delays-remove-decisions
blob: 8f0c7daa5317d047f153a0b836c2b908b03bf692 (plain)
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
97
98
99
100
101
102
103
104
105
106
#!/bin/sh
set -e

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

insertinstalledpackage 'stuff' 'all' '1'

insertpackage 'unstable' 'foobar' 'all' '1' 'Depends: foo | bar'
insertpackage 'unstable' 'foo' 'all' '1' 'Conflicts: stuff
Depends: foo-dep'
insertpackage 'unstable' 'foo-dep' 'all' '1' 'Depends: uninstallable'

insertpackage 'unstable' 'bar' 'all' '1'

setupaptarchive

# We are needlessly removing "stuff" if we don't delay its marking here
# as we do not question the remove later on
testsuccessequal "Reading package lists...
Building dependency tree...
  MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1
  Installing foo:amd64 as Depends of foobar:amd64
     Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1)
    MarkInstall foo:amd64 < none -> 1 @un uN Ib > FU=0
    Installing foo-dep:amd64 as Depends of foo:amd64
      foo-dep:amd64 Depends on uninstallable:amd64 < none @un H > can't be satisfied!
      foo:amd64 Depends on foo-dep:amd64 < none @un H > can't be satisfied! (dep)
  Installing bar:amd64 as Depends of foobar:amd64
    MarkInstall bar:amd64 < none -> 1 @un uN > FU=0
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
  bar
The following NEW packages will be installed:
  bar foobar
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Inst bar (1 unstable [all])
Inst foobar (1 unstable [all])
Conf bar (1 unstable [all])
Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1

insertinstalledpackage 'uninstallable' 'all' '1'

testsuccessequal "Reading package lists...
Building dependency tree...
  MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1
  Installing foo:amd64 as Depends of foobar:amd64
     Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1)
    MarkInstall foo:amd64 < none -> 1 @un uN Ib > FU=0
    Installing foo-dep:amd64 as Depends of foo:amd64
      MarkInstall foo-dep:amd64 < none -> 1 @un uN > FU=0
    MarkDelete stuff:amd64 < 1 @ii K > FU=0
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
  foo foo-dep
The following packages will be REMOVED:
  stuff
The following NEW packages will be installed:
  foo foo-dep foobar
  MarkDelete stuff:amd64 < 1 @ii K > FU=1
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Remv stuff [1]
Inst foo-dep (1 unstable [all])
Inst foo (1 unstable [all])
Inst foobar (1 unstable [all])
Conf foo-dep (1 unstable [all])
Conf foo (1 unstable [all])
Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1

# Same solution but the installs are considered protected now as there is no other solution
testsuccessequal "Reading package lists...
Building dependency tree...
  MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1
  Installing foo:amd64 as Depends of foobar:amd64
     Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1)
      MarkDelete stuff:amd64 < 1 @ii K > FU=0
    MarkInstall foo:amd64 < none -> 1 @un puN Ib > FU=0
    Installing foo-dep:amd64 as Depends of foo:amd64
      MarkInstall foo-dep:amd64 < none -> 1 @un puN > FU=0
        MarkInstall uninstallable:amd64 < 1 @ii pK > FU=0
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
  Ignore MarkGarbage of foo:amd64 < none -> 1 @un puN > as its mode (Install) is protected
Package 'bar' is not installed, so not removed
The following additional packages will be installed:
  foo foo-dep
The following packages will be REMOVED:
  stuff
The following NEW packages will be installed:
  foo foo-dep foobar
  MarkDelete stuff:amd64 < 1 | none @ii H > FU=1
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Remv stuff [1]
Inst foo-dep (1 unstable [all])
Inst foo (1 unstable [all])
Inst foobar (1 unstable [all])
Conf foo-dep (1 unstable [all])
Conf foo (1 unstable [all])
Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1