1 |
Ignore the @world package set and its dependencies. This may be useful |
2 |
if there is a desire to perform an action even though it might break |
3 |
the dependencies of some installed packages (it might also remove |
4 |
installed packages in order to solve blockers). This also alters the |
5 |
behavior of --complete-graph options so that only deep dependencies |
6 |
of packages given as arguments are included in the dependency graph. |
7 |
This option may be useful as an alternative to --nodeps in cases where |
8 |
it is desirable to account for dependencies of packages given as |
9 |
arguments. |
10 |
|
11 |
Bug: https://bugs.gentoo.org/608564 |
12 |
--- |
13 |
man/emerge.1 | 17 +++++++++++++++++ |
14 |
pym/_emerge/create_depgraph_params.py | 4 ++++ |
15 |
pym/_emerge/depgraph.py | 8 ++++++-- |
16 |
pym/_emerge/main.py | 9 +++++++++ |
17 |
pym/portage/tests/resolver/test_complete_graph.py | 18 ++++++++++++++++++ |
18 |
5 files changed, 54 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/man/emerge.1 b/man/emerge.1 |
21 |
index a17b65ed2..01ce62e51 100644 |
22 |
--- a/man/emerge.1 |
23 |
+++ b/man/emerge.1 |
24 |
@@ -630,6 +630,23 @@ Therefore, \fB\-\-usepkgonly\fR (or \fB\-\-getbinpkgonly\fR) must be |
25 |
used in order to enable soname depedency resolution when installing |
26 |
packages. |
27 |
.TP |
28 |
+.BR "\-\-ignore\-world [ y | n ]" |
29 |
+Ignore the @world package set and its dependencies. This may be useful |
30 |
+if there is a desire to perform an action even though it might break |
31 |
+the dependencies of some installed packages (it might also remove |
32 |
+installed packages in order to solve blockers). This also alters the |
33 |
+behavior of \fB\-\-complete\-graph\fR options so that only deep |
34 |
+dependencies of packages given as arguments are included in the |
35 |
+dependency graph. This option may be useful as an alternative to |
36 |
+\fB\-\-nodeps\fR in cases where it is desirable to account for |
37 |
+dependencies of packages given as arguments. |
38 |
+ |
39 |
+\fBWARNING:\fR |
40 |
+This option is intended to be used only with great caution, since it is |
41 |
+possible for it to make nonsensical changes which may lead to system |
42 |
+breakage. Therefore, it is advisable to use \fB\-\-ask\fR together with |
43 |
+this option. |
44 |
+.TP |
45 |
.BR \-j\ [JOBS] ", " \-\-jobs[=JOBS] |
46 |
Specifies the number of packages to build simultaneously. If this option is |
47 |
given without an argument, emerge will not limit the number of jobs that can |
48 |
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py |
49 |
index fc7fa60d7..0405011fd 100644 |
50 |
--- a/pym/_emerge/create_depgraph_params.py |
51 |
+++ b/pym/_emerge/create_depgraph_params.py |
52 |
@@ -26,6 +26,7 @@ def create_depgraph_params(myopts, myaction): |
53 |
# ignore_soname_deps: ignore the soname dependencies of built |
54 |
# packages, so that they do not trigger dependency resolution |
55 |
# failures, or cause packages to be rebuilt or replaced. |
56 |
+ # ignore_world: ignore the @world package set and its dependencies |
57 |
# with_test_deps: pull in test deps for packages matched by arguments |
58 |
# changed_deps: rebuild installed packages with outdated deps |
59 |
# changed_deps_report: report installed packages with outdated deps |
60 |
@@ -56,6 +57,9 @@ def create_depgraph_params(myopts, myaction): |
61 |
myparams["selective"] = True |
62 |
return myparams |
63 |
|
64 |
+ if myopts.get('--ignore-world') is True: |
65 |
+ myparams['ignore_world'] = True |
66 |
+ |
67 |
rebuild_if_new_slot = myopts.get('--rebuild-if-new-slot') |
68 |
if rebuild_if_new_slot is not None: |
69 |
myparams['rebuild_if_new_slot'] = rebuild_if_new_slot |
70 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
71 |
index 6c728684f..f7ea27c37 100644 |
72 |
--- a/pym/_emerge/depgraph.py |
73 |
+++ b/pym/_emerge/depgraph.py |
74 |
@@ -163,7 +163,10 @@ class _frozen_depgraph_config(object): |
75 |
self.trees[myroot]["bintree"] = DummyTree( |
76 |
DbapiProvidesIndex(trees[myroot]["bintree"].dbapi)) |
77 |
|
78 |
- self._required_set_names = set(["world"]) |
79 |
+ if params.get("ignore_world", False): |
80 |
+ self._required_set_names = set() |
81 |
+ else: |
82 |
+ self._required_set_names = set(["world"]) |
83 |
|
84 |
atoms = ' '.join(myopts.get("--exclude", [])).split() |
85 |
self.excluded_pkgs = _wildcard_set(atoms) |
86 |
@@ -7554,6 +7557,7 @@ class depgraph(object): |
87 |
ignored_uninstall_tasks = set() |
88 |
have_uninstall_task = False |
89 |
complete = "complete" in self._dynamic_config.myparams |
90 |
+ ignore_world = self._dynamic_config.myparams.get("ignore_world", False) |
91 |
asap_nodes = [] |
92 |
|
93 |
def get_nodes(**kwargs): |
94 |
@@ -7971,7 +7975,7 @@ class depgraph(object): |
95 |
# detected as early as possible, which makes it possible |
96 |
# to avoid calling self._complete_graph() when it is |
97 |
# unnecessary due to blockers triggering an abortion. |
98 |
- if not complete: |
99 |
+ if not (complete or ignore_world): |
100 |
# For packages in the world set, go ahead an uninstall |
101 |
# when necessary, as long as the atom will be satisfied |
102 |
# in the final state. |
103 |
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py |
104 |
index fbc2ce01c..5b48d32a4 100644 |
105 |
--- a/pym/_emerge/main.py |
106 |
+++ b/pym/_emerge/main.py |
107 |
@@ -146,6 +146,7 @@ def insert_optional_args(args): |
108 |
'--fuzzy-search' : y_or_n, |
109 |
'--getbinpkg' : y_or_n, |
110 |
'--getbinpkgonly' : y_or_n, |
111 |
+ '--ignore-world' : y_or_n, |
112 |
'--jobs' : valid_integers, |
113 |
'--keep-going' : y_or_n, |
114 |
'--load-average' : valid_floats, |
115 |
@@ -503,6 +504,11 @@ def parse_opts(tmpcmdline, silent=False): |
116 |
"choices": y_or_n |
117 |
}, |
118 |
|
119 |
+ "--ignore-world": { |
120 |
+ "help" : "ignore the @world package set and its dependencies", |
121 |
+ "choices" : true_y_or_n |
122 |
+ }, |
123 |
+ |
124 |
"--jobs": { |
125 |
|
126 |
"shortopt" : "-j", |
127 |
@@ -919,6 +925,9 @@ def parse_opts(tmpcmdline, silent=False): |
128 |
else: |
129 |
myoptions.getbinpkgonly = None |
130 |
|
131 |
+ if myoptions.ignore_world in true_y: |
132 |
+ myoptions.ignore_world = True |
133 |
+ |
134 |
if myoptions.keep_going in true_y: |
135 |
myoptions.keep_going = True |
136 |
else: |
137 |
diff --git a/pym/portage/tests/resolver/test_complete_graph.py b/pym/portage/tests/resolver/test_complete_graph.py |
138 |
index 95b1f8809..d02e57582 100644 |
139 |
--- a/pym/portage/tests/resolver/test_complete_graph.py |
140 |
+++ b/pym/portage/tests/resolver/test_complete_graph.py |
141 |
@@ -59,6 +59,12 @@ class CompleteGraphTestCase(TestCase): |
142 |
success = True, |
143 |
), |
144 |
|
145 |
+ ResolverPlaygroundTestCase( |
146 |
+ ["dev-libs/libxml2"], |
147 |
+ options = {"--ignore-world" : True}, |
148 |
+ mergelist = ["dev-libs/libxml2-2.8.0"], |
149 |
+ success = True, |
150 |
+ ), |
151 |
) |
152 |
|
153 |
playground = ResolverPlayground(ebuilds=ebuilds, |
154 |
@@ -99,6 +105,12 @@ class CompleteGraphTestCase(TestCase): |
155 |
), |
156 |
ResolverPlaygroundTestCase( |
157 |
[">=sys-libs/x-2"], |
158 |
+ options = {"--ignore-world" : True}, |
159 |
+ mergelist = ["sys-libs/x-2"], |
160 |
+ success = True, |
161 |
+ ), |
162 |
+ ResolverPlaygroundTestCase( |
163 |
+ [">=sys-libs/x-2"], |
164 |
options = {"--complete-graph-if-new-ver" : "y"}, |
165 |
mergelist = ["sys-libs/x-2"], |
166 |
slot_collision_solutions = [], |
167 |
@@ -112,6 +124,12 @@ class CompleteGraphTestCase(TestCase): |
168 |
), |
169 |
ResolverPlaygroundTestCase( |
170 |
["<sys-libs/x-1"], |
171 |
+ options = {"--ignore-world" : True}, |
172 |
+ mergelist = ["sys-libs/x-0.1"], |
173 |
+ success = True, |
174 |
+ ), |
175 |
+ ResolverPlaygroundTestCase( |
176 |
+ ["<sys-libs/x-1"], |
177 |
options = {"--complete-graph-if-new-ver" : "y"}, |
178 |
mergelist = ["sys-libs/x-0.1"], |
179 |
slot_collision_solutions = [], |
180 |
-- |
181 |
2.13.6 |