1 |
The --newrepo flag tells emerge to recompile a package if it is now being |
2 |
pulled from a different repository. |
3 |
|
4 |
BUG=chromium:200417 |
5 |
TEST=Verify ebuilds get pulled in when repo changes. |
6 |
--- |
7 |
man/emerge.1 | 5 +++ |
8 |
pym/_emerge/create_depgraph_params.py | 1 + |
9 |
pym/_emerge/depgraph.py | 80 |
10 |
++++++++++++++++++----------------- |
11 |
pym/_emerge/help.py | 2 +- |
12 |
4 files changed, 48 insertions(+), 40 deletions(-) |
13 |
|
14 |
diff --git a/man/emerge.1 b/man/emerge.1 |
15 |
index 7b507fe..eacb77a 100644 |
16 |
--- a/man/emerge.1 |
17 |
+++ b/man/emerge.1 |
18 |
@@ -553,6 +553,11 @@ a list of packages with similar names when a package |
19 |
doesn't exist. |
20 |
The \fIEMERGE_DEFAULT_OPTS\fR variable may be used to disable this |
21 |
option by default. |
22 |
.TP |
23 |
+.BR "\-\-newrepo " |
24 |
+Tells emerge to recompile a package if it is now being pulled from a |
25 |
+different repository. This option also implies the |
26 |
+\fB\-\-selective\fR option. |
27 |
+.TP |
28 |
.BR "\-\-newuse " (\fB\-N\fR) |
29 |
Tells emerge to include installed packages where USE |
30 |
flags have changed since compilation. This option |
31 |
diff --git a/pym/_emerge/create_depgraph_params.py |
32 |
b/pym/_emerge/create_depgraph_params.py |
33 |
index 98a7646..f9accf0 100644 |
34 |
--- a/pym/_emerge/create_depgraph_params.py |
35 |
+++ b/pym/_emerge/create_depgraph_params.py |
36 |
@@ -46,6 +46,7 @@ def create_depgraph_params(myopts, myaction): |
37 |
myparams['rebuild_if_new_slot'] = rebuild_if_new_slot |
38 |
|
39 |
if "--update" in myopts or \ |
40 |
+ "--newrepo" in myopts or \ |
41 |
"--newuse" in myopts or \ |
42 |
"--reinstall" in myopts or \ |
43 |
"--noreplace" in myopts or \ |
44 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
45 |
index ae6b883..fe1b48e 100644 |
46 |
--- a/pym/_emerge/depgraph.py |
47 |
+++ b/pym/_emerge/depgraph.py |
48 |
@@ -5389,54 +5389,56 @@ class depgraph(object): |
49 |
break |
50 |
# Compare built package to current |
51 |
config and |
52 |
# reject the built package if |
53 |
necessary. |
54 |
+ reinstall_use = ("--newuse" in |
55 |
self._frozen_config.myopts or \ |
56 |
+ "--reinstall" in |
57 |
self._frozen_config.myopts) |
58 |
+ respect_use = |
59 |
self._dynamic_config.myparams.get("binpkg_respect_use") in ("y", "auto") |
60 |
if built and not useoldpkg and \ |
61 |
(not installed or |
62 |
matched_packages) and \ |
63 |
not (installed and |
64 |
|
65 |
self._frozen_config.excluded_pkgs.findAtomForPackage(pkg, |
66 |
- |
67 |
modified_use=self._pkg_use_enabled(pkg))) and \ |
68 |
- ("--newuse" in |
69 |
self._frozen_config.myopts or \ |
70 |
- "--reinstall" in |
71 |
self._frozen_config.myopts or \ |
72 |
- (not installed and |
73 |
self._dynamic_config.myparams.get( |
74 |
- "binpkg_respect_use") in |
75 |
("y", "auto"))): |
76 |
- iuses = pkg.iuse.all |
77 |
- old_use = |
78 |
self._pkg_use_enabled(pkg) |
79 |
- if myeb: |
80 |
- |
81 |
pkgsettings.setcpv(myeb) |
82 |
- else: |
83 |
- |
84 |
pkgsettings.setcpv(pkg) |
85 |
- now_use = |
86 |
pkgsettings["PORTAGE_USE"].split() |
87 |
- forced_flags = set() |
88 |
- |
89 |
forced_flags.update(pkgsettings.useforce) |
90 |
- |
91 |
forced_flags.update(pkgsettings.usemask) |
92 |
- cur_iuse = iuses |
93 |
- if myeb and not usepkgonly |
94 |
and not useoldpkg: |
95 |
- cur_iuse = |
96 |
myeb.iuse.all |
97 |
- reinstall_for_flags = |
98 |
self._reinstall_for_flags(pkg, |
99 |
- forced_flags, |
100 |
old_use, iuses, now_use, cur_iuse) |
101 |
- if reinstall_for_flags: |
102 |
- if not |
103 |
pkg.installed: |
104 |
- |
105 |
self._dynamic_config.ignored_binaries.setdefault(pkg, |
106 |
set()).update(reinstall_for_flags) |
107 |
+ |
108 |
modified_use=self._pkg_use_enabled(pkg))): |
109 |
+ if myeb and "--newrepo" in |
110 |
self._frozen_config.myopts and myeb.repo != pkg.repo: |
111 |
break |
112 |
+ elif reinstall_use or (not |
113 |
installed and respect_use): |
114 |
+ iuses = pkg.iuse.all |
115 |
+ old_use = |
116 |
self._pkg_use_enabled(pkg) |
117 |
+ if myeb: |
118 |
+ |
119 |
pkgsettings.setcpv(myeb) |
120 |
+ else: |
121 |
+ |
122 |
pkgsettings.setcpv(pkg) |
123 |
+ now_use = |
124 |
pkgsettings["PORTAGE_USE"].split() |
125 |
+ forced_flags = set() |
126 |
+ |
127 |
forced_flags.update(pkgsettings.useforce) |
128 |
+ |
129 |
forced_flags.update(pkgsettings.usemask) |
130 |
+ cur_iuse = iuses |
131 |
+ if myeb and not |
132 |
usepkgonly and not useoldpkg: |
133 |
+ cur_iuse = |
134 |
myeb.iuse.all |
135 |
+ reinstall_for_flags |
136 |
= self._reinstall_for_flags(pkg, |
137 |
+ |
138 |
forced_flags, old_use, iuses, now_use, cur_iuse) |
139 |
+ if |
140 |
reinstall_for_flags: |
141 |
+ if not |
142 |
pkg.installed: |
143 |
+ |
144 |
self._dynamic_config.ignored_binaries.setdefault(pkg, |
145 |
set()).update(reinstall_for_flags) |
146 |
+ break |
147 |
# Compare current config to |
148 |
installed package |
149 |
# and do not reinstall if possible. |
150 |
- if not installed and not useoldpkg |
151 |
and \ |
152 |
- ("--newuse" in |
153 |
self._frozen_config.myopts or \ |
154 |
- "--reinstall" in |
155 |
self._frozen_config.myopts) and \ |
156 |
- cpv in vardb.match(atom): |
157 |
- forced_flags = set() |
158 |
- |
159 |
forced_flags.update(pkg.use.force) |
160 |
- |
161 |
forced_flags.update(pkg.use.mask) |
162 |
+ if not installed and not useoldpkg |
163 |
and cpv in vardb.match(atom): |
164 |
inst_pkg = |
165 |
vardb.match_pkgs('=' + pkg.cpv)[0] |
166 |
- old_use = |
167 |
inst_pkg.use.enabled |
168 |
- old_iuse = inst_pkg.iuse.all |
169 |
- cur_use = |
170 |
self._pkg_use_enabled(pkg) |
171 |
- cur_iuse = pkg.iuse.all |
172 |
- reinstall_for_flags = \ |
173 |
- |
174 |
self._reinstall_for_flags(pkg, |
175 |
- forced_flags, |
176 |
old_use, old_iuse, |
177 |
- cur_use, cur_iuse) |
178 |
- if reinstall_for_flags: |
179 |
+ if "--newrepo" in |
180 |
self._frozen_config.myopts and pkg.repo != inst_pkg.repo: |
181 |
reinstall = True |
182 |
+ elif reinstall_use: |
183 |
+ forced_flags = set() |
184 |
+ |
185 |
forced_flags.update(pkg.use.force) |
186 |
+ |
187 |
forced_flags.update(pkg.use.mask) |
188 |
+ old_use = |
189 |
inst_pkg.use.enabled |
190 |
+ old_iuse = |
191 |
inst_pkg.iuse.all |
192 |
+ cur_use = |
193 |
self._pkg_use_enabled(pkg) |
194 |
+ cur_iuse = |
195 |
pkg.iuse.all |
196 |
+ reinstall_for_flags |
197 |
= \ |
198 |
+ |
199 |
self._reinstall_for_flags(pkg, |
200 |
+ |
201 |
forced_flags, old_use, old_iuse, |
202 |
+ cur_use, |
203 |
cur_iuse) |
204 |
+ if |
205 |
reinstall_for_flags: |
206 |
+ reinstall = |
207 |
True |
208 |
if |
209 |
reinstall_atoms.findAtomForPackage(pkg, \ |
210 |
|
211 |
modified_use=self._pkg_use_enabled(pkg)): |
212 |
reinstall = True |
213 |
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py |
214 |
index 52cfd00..ab4e88f 100644 |
215 |
--- a/pym/_emerge/help.py |
216 |
+++ b/pym/_emerge/help.py |
217 |
@@ -17,7 +17,7 @@ def help(): |
218 |
print(" [ " + green("--color")+" < " + turquoise("y") + " |
219 |
| "+ turquoise("n")+" > ] [ "+green("--columns")+" ]") |
220 |
print(" [ "+green("--complete-graph")+" ] [ |
221 |
"+green("--deep")+" ]") |
222 |
print(" [ "+green("--jobs") + " " + turquoise("JOBS")+" ] |
223 |
[ "+green("--keep-going")+" ] [ " + green("--load-average")+" " + |
224 |
turquoise("LOAD") + " ]") |
225 |
- print(" [ "+green("--newuse")+" ] [ |
226 |
"+green("--noconfmem")+" ] [ "+green("--nospinner")+" ]") |
227 |
+ print(" [ "+green("--newrepo")+" ] [ |
228 |
"+green("--newuse")+" ] [ "+green("--noconfmem")+" ] [ |
229 |
"+green("--nospinner")+" ]") |
230 |
print(" [ "+green("--oneshot")+" ] [ |
231 |
"+green("--onlydeps")+" ] [ "+ green("--quiet-build")+" [ " + |
232 |
turquoise("y") + " | "+ turquoise("n")+" ] ]") |
233 |
print(" [ "+green("--reinstall |
234 |
")+turquoise("changed-use")+" ] [ " + green("--with-bdeps")+" < " + |
235 |
turquoise("y") + " | "+ turquoise("n")+" > ]") |
236 |
print(bold("Actions:")+" [ "+green("--depclean")+" | |
237 |
"+green("--list-sets")+" | "+green("--search")+" | "+green("--sync")+" | |
238 |
"+green("--version")+" ]") |
239 |
-- |
240 |
1.8.0.2 |