1 |
Author: grobian |
2 |
Date: 2009-08-04 16:29:35 +0000 (Tue, 04 Aug 2009) |
3 |
New Revision: 13897 |
4 |
|
5 |
Removed: |
6 |
main/branches/prefix/bin/setsid |
7 |
Modified: |
8 |
main/branches/prefix/bin/ebuild.sh |
9 |
main/branches/prefix/bin/isolated-functions.sh |
10 |
main/branches/prefix/bin/repoman |
11 |
main/branches/prefix/man/repoman.1 |
12 |
main/branches/prefix/pym/_emerge/depgraph.py |
13 |
main/branches/prefix/pym/_emerge/main.py |
14 |
main/branches/prefix/pym/portage/__init__.py |
15 |
main/branches/prefix/pym/portage/dep.py |
16 |
Log: |
17 |
Merged from trunk -r13874:13887 |
18 |
|
19 |
| 13879 | Remove the code from bug #278895 since we're going to need | |
20 |
| zmedico | a daemon process in the ebuild's login session in order to | |
21 |
| | pass signals from the controlling terminal to the detached | |
22 |
| | session. A simple fifo-based approach in ebuild.sh does not | |
23 |
| | seem to work since bash's read builtin occasionally loses | |
24 |
| | the fifo data when it's 'Interrupted system call'. Maybe a | |
25 |
| | python script will work better for the session | |
26 |
| | leader/daemon. NOTE: The daemon will also be useful for | |
27 |
| | implementing a fifo-based die helper (to replace the | |
28 |
| | current signal- based approach). | |
29 |
|
30 |
| 13880 | Bug #278729 - Add an Atom.without_use attribute which is | |
31 |
| zmedico | identical to the atom itself, except without any USE | |
32 |
| | dependencies. | |
33 |
|
34 |
| 13881 | Bug #278729 - Inside dep_zapdeps(), ignore USE dependencies | |
35 |
| zmedico | since we don't want USE settings to adversely affect || | |
36 |
| | preference evaluation. Drop invalid atoms inside | |
37 |
| | _expand_new_virtuals() since we only want real Atom | |
38 |
| | instances inside dep_zapdeps(). | |
39 |
|
40 |
| 13882 | Make the USE=test RDEPEND check (bug #236786) also apply to | |
41 |
| zmedico | PDEPEND. | |
42 |
|
43 |
| 13883 | Fix NameError from r13880. Thanks to Arfrever for | |
44 |
| zmedico | reporting. | |
45 |
|
46 |
| 13884 | Add a PDEPEND.suspect category. | |
47 |
| zmedico | | |
48 |
|
49 |
| 13887 | Set "emerge" xterm title at the beginning of running | |
50 |
| arfrever | emerge. | |
51 |
|
52 |
|
53 |
Modified: main/branches/prefix/bin/ebuild.sh |
54 |
=================================================================== |
55 |
--- main/branches/prefix/bin/ebuild.sh 2009-08-04 16:24:14 UTC (rev 13896) |
56 |
+++ main/branches/prefix/bin/ebuild.sh 2009-08-04 16:29:35 UTC (rev 13897) |
57 |
@@ -27,19 +27,6 @@ |
58 |
PATH="$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}:${ROOTPATH:+:}$ROOTPATH" |
59 |
export PATH |
60 |
|
61 |
-if [[ -z $PORTAGE_SETSID && -n $1 && $1 != depend ]] ; then |
62 |
- # If available, use setsid to create a new login session so that we can use |
63 |
- # SIGHUP to ensure that no orphaned subprocesses are left running. |
64 |
- if type -P setsid >/dev/null ; then |
65 |
- export PORTAGE_SETSID=1 |
66 |
- exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" "$@" |
67 |
- elif [[ -x $PORTAGE_BIN_PATH/setsid ]] ; then |
68 |
- export PORTAGE_SETSID=1 |
69 |
- exec "$PORTAGE_BIN_PATH/setsid" "$PORTAGE_BIN_PATH/ebuild.sh" "$@" |
70 |
- fi |
71 |
-fi |
72 |
-[[ $PORTAGE_SETSID = 1 ]] && trap 'trap : SIGHUP ; kill -s SIGHUP 0 ;' EXIT |
73 |
- |
74 |
# These two functions wrap sourcing and calling respectively. At present they |
75 |
# perform a qa check to make sure eclasses and ebuilds and profiles don't mess |
76 |
# with shell opts (shopts). Ebuilds/eclasses changing shopts should reset them |
77 |
|
78 |
Modified: main/branches/prefix/bin/isolated-functions.sh |
79 |
=================================================================== |
80 |
--- main/branches/prefix/bin/isolated-functions.sh 2009-08-04 16:24:14 UTC (rev 13896) |
81 |
+++ main/branches/prefix/bin/isolated-functions.sh 2009-08-04 16:29:35 UTC (rev 13897) |
82 |
@@ -538,8 +538,7 @@ |
83 |
PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \ |
84 |
PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \ |
85 |
PORTAGE_QUIET \ |
86 |
- PORTAGE_REPO_NAME PORTAGE_RESTRICT \ |
87 |
- PORTAGE_SETSID PORTAGE_UPDATE_ENV \ |
88 |
+ PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_UPDATE_ENV \ |
89 |
PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR \ |
90 |
PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \ |
91 |
PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \ |
92 |
|
93 |
Modified: main/branches/prefix/bin/repoman |
94 |
=================================================================== |
95 |
--- main/branches/prefix/bin/repoman 2009-08-04 16:24:14 UTC (rev 13896) |
96 |
+++ main/branches/prefix/bin/repoman 2009-08-04 16:29:35 UTC (rev 13897) |
97 |
@@ -282,6 +282,7 @@ |
98 |
"DEPEND.badmaskedindev":"Masked ebuilds with bad DEPEND settings (matched against *all* ebuilds) in developing arch", |
99 |
"RDEPEND.badmaskedindev":"Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch", |
100 |
"PDEPEND.badmaskedindev":"Masked ebuilds with PDEPEND settings (matched against *all* ebuilds) in developing arch", |
101 |
+ "PDEPEND.suspect":"PDEPEND contains a package that usually only belongs in DEPEND.", |
102 |
"DEPEND.syntax":"Syntax error in DEPEND (usually an extra/missing space/parenthesis)", |
103 |
"RDEPEND.syntax":"Syntax error in RDEPEND (usually an extra/missing space/parenthesis)", |
104 |
"PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)", |
105 |
@@ -342,6 +343,7 @@ |
106 |
"KEYWORDS.missing", |
107 |
"IUSE.invalid", |
108 |
"IUSE.undefined", |
109 |
+"PDEPEND.suspect", |
110 |
"RDEPEND.implicit", |
111 |
"RDEPEND.suspect", |
112 |
"RESTRICT.invalid", |
113 |
@@ -1411,10 +1413,11 @@ |
114 |
for token in mydepstr.split(): |
115 |
if token in operator_tokens or \ |
116 |
token[-1:] == "?": |
117 |
- if token == "test?" and mytype == "RDEPEND": |
118 |
- stats['RDEPEND.suspect'] += 1 |
119 |
- fails['RDEPEND.suspect'].append(relative_path + \ |
120 |
- ": 'test?' USE conditional in RDEPEND") |
121 |
+ if token == "test?" and \ |
122 |
+ mytype in ("RDEPEND", "PDEPEND"): |
123 |
+ stats[mytype + '.suspect'] += 1 |
124 |
+ fails[mytype + '.suspect'].append(relative_path + \ |
125 |
+ ": 'test?' USE conditional in %s" % mytype) |
126 |
continue |
127 |
try: |
128 |
atom = portage.dep.Atom(token) |
129 |
@@ -1429,11 +1432,11 @@ |
130 |
portage.dep_getkey(atom) == "virtual/jdk": |
131 |
stats['java.eclassesnotused'] += 1 |
132 |
fails['java.eclassesnotused'].append(relative_path) |
133 |
- elif mytype == "RDEPEND": |
134 |
+ elif mytype in ("PDEPEND", "RDEPEND"): |
135 |
if not is_blocker and \ |
136 |
portage.dep_getkey(atom) in suspect_rdepend: |
137 |
- stats['RDEPEND.suspect'] += 1 |
138 |
- fails['RDEPEND.suspect'].append( |
139 |
+ stats[mytype + '.suspect'] += 1 |
140 |
+ fails[mytype + '.suspect'].append( |
141 |
relative_path + ": '%s'" % atom) |
142 |
if eapi == "0": |
143 |
if portage.dep.dep_getslot(atom): |
144 |
|
145 |
Deleted: main/branches/prefix/bin/setsid |
146 |
=================================================================== |
147 |
--- main/branches/prefix/bin/setsid 2009-08-04 16:24:14 UTC (rev 13896) |
148 |
+++ main/branches/prefix/bin/setsid 2009-08-04 16:29:35 UTC (rev 13897) |
149 |
@@ -1,10 +0,0 @@ |
150 |
-#!@PORTAGE_PYTHON@ -O |
151 |
-# Copyright 2009 Gentoo Foundation |
152 |
-# Distributed under the terms of the GNU General Public License v2 |
153 |
-# $Id$ |
154 |
- |
155 |
-import os |
156 |
-import sys |
157 |
- |
158 |
-os.setsid() |
159 |
-os.execl(sys.argv[1], *sys.argv[1:]) |
160 |
|
161 |
Modified: main/branches/prefix/man/repoman.1 |
162 |
=================================================================== |
163 |
--- main/branches/prefix/man/repoman.1 2009-08-04 16:24:14 UTC (rev 13896) |
164 |
+++ main/branches/prefix/man/repoman.1 2009-08-04 16:29:35 UTC (rev 13897) |
165 |
@@ -161,6 +161,9 @@ |
166 |
.B PDEPEND.badmaskedindev |
167 |
Masked ebuilds with PDEPEND settings (matched against *all* ebuilds) in developing arch |
168 |
.TP |
169 |
+.B PDEPEND.suspect |
170 |
+PDEPEND contains a package that usually only belongs in DEPEND |
171 |
+.TP |
172 |
.B PDEPEND.syntax |
173 |
Syntax error in PDEPEND (usually an extra/missing space/parenthesis) |
174 |
.TP |
175 |
|
176 |
Modified: main/branches/prefix/pym/_emerge/depgraph.py |
177 |
=================================================================== |
178 |
--- main/branches/prefix/pym/_emerge/depgraph.py 2009-08-04 16:24:14 UTC (rev 13896) |
179 |
+++ main/branches/prefix/pym/_emerge/depgraph.py 2009-08-04 16:29:35 UTC (rev 13897) |
180 |
@@ -714,14 +714,8 @@ |
181 |
else: |
182 |
# Do not backtrack if only USE have to be changed in |
183 |
# order to satisfy the dependency. |
184 |
- atom_without_use = dep.atom |
185 |
- if dep.atom.use: |
186 |
- atom_without_use = portage.dep.remove_slot(dep.atom) |
187 |
- if dep.atom.slot: |
188 |
- atom_without_use += ":" + dep.atom.slot |
189 |
- atom_without_use = portage.dep.Atom(atom_without_use) |
190 |
dep_pkg, existing_node = \ |
191 |
- self._select_package(dep.root, atom_without_use, |
192 |
+ self._select_package(dep.root, dep.atom.without_use, |
193 |
onlydeps=dep.onlydeps) |
194 |
if dep_pkg is None: |
195 |
self._dynamic_config._runtime_pkg_mask.setdefault( |
196 |
@@ -1847,12 +1841,6 @@ |
197 |
def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None): |
198 |
atom = portage.dep.Atom(atom) |
199 |
atom_set = InternalPackageSet(initial_atoms=(atom,)) |
200 |
- atom_without_use = atom |
201 |
- if atom.use: |
202 |
- atom_without_use = portage.dep.remove_slot(atom) |
203 |
- if atom.slot: |
204 |
- atom_without_use += ":" + atom.slot |
205 |
- atom_without_use = portage.dep.Atom(atom_without_use) |
206 |
xinfo = '"%s"' % atom |
207 |
if arg: |
208 |
xinfo='"%s"' % arg |
209 |
@@ -1873,9 +1861,9 @@ |
210 |
continue |
211 |
match = db.match |
212 |
if hasattr(db, "xmatch"): |
213 |
- cpv_list = db.xmatch("match-all", atom_without_use) |
214 |
+ cpv_list = db.xmatch("match-all", atom.without_use) |
215 |
else: |
216 |
- cpv_list = db.match(atom_without_use) |
217 |
+ cpv_list = db.match(atom.without_use) |
218 |
# descending order |
219 |
cpv_list.reverse() |
220 |
for cpv in cpv_list: |
221 |
|
222 |
Modified: main/branches/prefix/pym/_emerge/main.py |
223 |
=================================================================== |
224 |
--- main/branches/prefix/pym/_emerge/main.py 2009-08-04 16:24:14 UTC (rev 13896) |
225 |
+++ main/branches/prefix/pym/_emerge/main.py 2009-08-04 16:29:35 UTC (rev 13897) |
226 |
@@ -31,7 +31,7 @@ |
227 |
|
228 |
import _emerge.help |
229 |
import portage.xpak, commands, errno, re, time |
230 |
-from portage.output import colorize, xtermTitleReset |
231 |
+from portage.output import colorize, xtermTitle, xtermTitleReset |
232 |
from portage.output import create_color_func |
233 |
good = create_color_func("GOOD") |
234 |
bad = create_color_func("BAD") |
235 |
@@ -1046,6 +1046,8 @@ |
236 |
portdb = trees[settings["ROOT"]]["porttree"].dbapi |
237 |
|
238 |
xterm_titles = "notitles" not in settings.features |
239 |
+ if xterm_titles: |
240 |
+ xtermTitle("emerge") |
241 |
|
242 |
tmpcmdline = [] |
243 |
if "--ignore-default-opts" not in myopts: |
244 |
@@ -1306,7 +1308,7 @@ |
245 |
"""This gets out final log message in before we quit.""" |
246 |
if "--pretend" not in myopts: |
247 |
emergelog(xterm_titles, " *** terminating.") |
248 |
- if "notitles" not in settings.features: |
249 |
+ if xterm_titles: |
250 |
xtermTitleReset() |
251 |
portage.atexit_register(emergeexit) |
252 |
|
253 |
|
254 |
Modified: main/branches/prefix/pym/portage/__init__.py |
255 |
=================================================================== |
256 |
--- main/branches/prefix/pym/portage/__init__.py 2009-08-04 16:24:14 UTC (rev 13896) |
257 |
+++ main/branches/prefix/pym/portage/__init__.py 2009-08-04 16:29:35 UTC (rev 13897) |
258 |
@@ -1049,7 +1049,6 @@ |
259 |
"EBUILD_PHASE", "EMERGE_FROM", "HOMEPAGE", "INHERITED", "IUSE", |
260 |
"KEYWORDS", "LICENSE", "PDEPEND", "PF", "PKGUSE", |
261 |
"PORTAGE_CONFIGROOT", "PORTAGE_IUSE", "PORTAGE_REPO_NAME", |
262 |
- "PORTAGE_SETSID", |
263 |
"PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT", |
264 |
"ROOT", "SLOT", "SRC_URI", "EPREFIX", "EROOT" |
265 |
] |
266 |
@@ -6944,6 +6943,9 @@ |
267 |
if portage.dep._dep_check_strict: |
268 |
raise portage.exception.ParseError( |
269 |
"invalid atom: '%s'" % x) |
270 |
+ else: |
271 |
+ # Only real Atom instances are allowed past this point. |
272 |
+ continue |
273 |
else: |
274 |
if x.blocker and x.blocker.overlap.forbid and \ |
275 |
eapi in ("0", "1") and portage.dep._dep_check_strict: |
276 |
@@ -7165,7 +7167,9 @@ |
277 |
for atom in atoms: |
278 |
if atom[:1] == "!": |
279 |
continue |
280 |
- avail_pkg = mydbapi.match(atom) |
281 |
+ # Ignore USE dependencies here since we don't want USE |
282 |
+ # settings to adversely affect || preference evaluation. |
283 |
+ avail_pkg = mydbapi.match(atom.without_use) |
284 |
if avail_pkg: |
285 |
avail_pkg = avail_pkg[-1] # highest (ascending order) |
286 |
avail_slot = "%s:%s" % (dep_getkey(atom), |
287 |
|
288 |
Modified: main/branches/prefix/pym/portage/dep.py |
289 |
=================================================================== |
290 |
--- main/branches/prefix/pym/portage/dep.py 2009-08-04 16:24:14 UTC (rev 13896) |
291 |
+++ main/branches/prefix/pym/portage/dep.py 2009-08-04 16:29:35 UTC (rev 13897) |
292 |
@@ -511,7 +511,7 @@ |
293 |
_atoms = weakref.WeakValueDictionary() |
294 |
|
295 |
__slots__ = ("__weakref__", "blocker", "cp", "cpv", "operator", |
296 |
- "slot", "use", "_str") |
297 |
+ "slot", "use", "without_use", "_str",) |
298 |
|
299 |
class _blocker(object): |
300 |
__slots__ = ("overlap",) |
301 |
@@ -550,9 +550,16 @@ |
302 |
use = dep_getusedeps(s) |
303 |
if use: |
304 |
use = _use_dep(use) |
305 |
+ without_use = remove_slot(self) |
306 |
+ if self.slot is not None: |
307 |
+ without_use += ":" + self.slot |
308 |
+ without_use = Atom(without_use) |
309 |
else: |
310 |
use = None |
311 |
+ without_use = self |
312 |
+ |
313 |
obj_setattr(self, "use", use) |
314 |
+ obj_setattr(self, "without_use", without_use) |
315 |
|
316 |
def __setattr__(self, name, value): |
317 |
raise AttributeError("Atom instances are immutable", |