Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9373 - in main/branches/prefix: . bin cnf man pym/_emerge pym/portage pym/repoman
Date: Sat, 23 Feb 2008 23:33:51
Message-Id: E1JT3sK-0002SA-20@stork.gentoo.org
1 Author: grobian
2 Date: 2008-02-23 23:33:46 +0000 (Sat, 23 Feb 2008)
3 New Revision: 9373
4
5 Removed:
6 main/branches/prefix/make-man-tarball.sh
7 Modified:
8 main/branches/prefix/DEVELOPING
9 main/branches/prefix/NEWS
10 main/branches/prefix/RELEASE-NOTES
11 main/branches/prefix/bin/ebuild.sh
12 main/branches/prefix/bin/isolated-functions.sh
13 main/branches/prefix/bin/repoman
14 main/branches/prefix/cnf/make.conf
15 main/branches/prefix/cnf/make.conf.sparc-fbsd.diff
16 main/branches/prefix/cnf/make.conf.x86-fbsd.diff
17 main/branches/prefix/man/ebuild.5
18 main/branches/prefix/man/emerge.1
19 main/branches/prefix/pym/_emerge/__init__.py
20 main/branches/prefix/pym/portage/__init__.py
21 main/branches/prefix/pym/repoman/utilities.py
22 main/branches/prefix/tarball.sh
23 Log:
24 Merged from trunk 9300:9333
25
26 | 9301 | Bug #208708 - Show informative warning messages for |
27 | zmedico | installed packages that are masked. |
28
29 | 9307 | removing obsolete cruft |
30 | genone | |
31
32 | 9308 | new script for creating release tarballs |
33 | genone | (Deleted in Prefix as we have a working tarball.sh) |
34
35 | 9309 | minor documentation updates |
36 | genone | |
37
38 | 9310 | more minor doc updates regarding package sets |
39 | genone | |
40
41 | 9311 | add preserve-libs info to make.conf.example |
42 | genone | |
43
44 | 9312 | add tagging capabilities and cli options |
45 | genone | |
46
47 | 9313 | Bug #208743 - Update dosed docs to indicate that |
48 | zmedico | "s:${D}::g" is used as the default expression if none |
49 | | other is given. |
50
51 | 9316 | fix nasty typo |
52 | genone | (Prefix already had most of this fix) |
53
54 | 9318 | Fix get_mask_info() to properly pass the "installed" |
55 | zmedico | attribute into the Package constructor. |
56
57 | 9320 | Fix the exitcode logic for bug #209144 so that when the |
58 | zmedico | server is out of date it's not interpreted like an actual |
59 | | rsync exitcode (to avoid a misleading exitcode |
60 | | interpretation message). |
61
62 | 9321 | Bug #209144 - For emerge --sync, show an informative error |
63 | zmedico | and don't return 1 when PORTAGE_RSYNC_RETRIES is exceeded. |
64
65 | 9324 | Fix CHOST masking logic wrt installed packages so that |
66 | zmedico | it's consistent between visible() and |
67 | | get_masking_status(). |
68
69 | 9326 | Fix rejects. |
70 | zmedico | |
71
72 | 9327 | Remove the killparent() function and associated SIGINT |
73 | zmedico | trap since this should already be handled on the python |
74 | | side and it won't work with dropped privileges anyway. |
75
76 | 9328 | fix more trivial issues breaking repoman |
77 | genone | |
78
79 | 9330 | Bug #209538 - Disable annoying "masked by keyword" |
80 | zmedico | warnings for installed packages. We can assume that if the |
81 | | user accepted the keywords at merge time then they never |
82 | | want to be bothered again. |
83
84 | 9332 | Add bits about namespace pollution, add whitespacing |
85 | WarnerBro | comments after looking at some new code I wrote and |
86 | | realizing I was not following the current style. Fix typos |
87
88 | 9333 | Bug #209768 - Fix --search "Size of files:" handling so |
89 | zmedico | that it properly shows the "Unknown (missing digest)" |
90 | | message instead of a traceback. |
91
92
93 Modified: main/branches/prefix/DEVELOPING
94 ===================================================================
95 --- main/branches/prefix/DEVELOPING 2008-02-23 01:20:48 UTC (rev 9372)
96 +++ main/branches/prefix/DEVELOPING 2008-02-23 23:33:46 UTC (rev 9373)
97 @@ -1,11 +1,39 @@
98 Code Guidelines
99 ---------------
100 -A few code guidelines to try to stick to, please comment of none of these make
101 +A few code guidelines to try to stick to, please comment if none of these make
102 sense, they are pretty basic and mostly apply to old code. However for people
103 who are looking at current code, they make take up bad habits that exist in the
104 current codebase.
105
106 -Strings
107 +Tabs
108 +----
109 +
110 +The current code uses tabs, not spaces. Keep whitespace usage consistent
111 +between files. New files should use tabs.
112 +
113 +Line-Wrapping
114 +-------------
115 +
116 +Lines should typically not be longer than 80 characters; if they are an attempt
117 +should be made to wrap them. Move code to the line below and indent once (\t).
118 +
119 +errors.append(MalformedMetadata(
120 + errors.DESCRIPTION_TOO_LONG_ERROR % \
121 + (length, max_desc_len),
122 + attr='DESCRIPTION.toolong')
123 +
124 +Do not do this:
125 +
126 +errors.append(MalformedMetadata(
127 + errors.DESCRIPTION_TOO_LONG_ERROR % \
128 + (length, max_desc_len),
129 + attr='DESCRIPTION.toolong')
130 +
131 +The mixing of tabs and spaces means other developers can't read what you did.
132 +This is why the python peps state spaces over tabs; because with spaces the line
133 +wrapping is always clear (but you cannot convert spaces as easily as tabwidth).
134 +
135 +String
136 -------
137 Try not to use the functions in the string module, they are deprecated.
138
139 @@ -21,7 +49,7 @@
140
141 should be replaced with:
142
143 -string.split(delimeter)
144 +"somestring".split(delimeter)
145
146 Nearly all other methods in string work on string objects and have similar calling
147 conventions.
148 @@ -102,3 +130,36 @@
149 import portage.util
150 import time
151 import sys
152 +
153 +Try not to import large numbers of things into the namespace of a module.
154 +I realize this is done all over the place in current code but it really makes it
155 +a pain to do code reflection when the namespace is cluttered with identifiers
156 +from other modules.
157 +
158 +YES:
159 +
160 +from portage import output
161 +
162 +NO:
163 +
164 +from portage.output import bold, create_color_func, darkgreen, \
165 + green, nocolor, red, turquoise, yellow
166 +
167 +The YES example imports the 'output' module into the current namespace.
168 +The negative here is having to use output.COLOR all over the place instead of
169 +just COLOR. However it means during introspection of the current namespace
170 +'green','red', 'yellow', etc. will not show up.
171 +
172 +The NO example just imports a set of functions from the output module. It is
173 +somewhat annoying because the import line needs to be modified when functions
174 +are needed and often unused functions are left in the import line until someone
175 +comes along with a linter to clean up (does not happen often). The color is a
176 +bit clearer as
177 +
178 + print red('blar')
179 +
180 +is shorter than:
181 +
182 + print output.red('blar')
183 +
184 +Rationale: python -c 'import portage; dir(portage)' (circa 02/2008)
185
186 Modified: main/branches/prefix/NEWS
187 ===================================================================
188 --- main/branches/prefix/NEWS 2008-02-23 01:20:48 UTC (rev 9372)
189 +++ main/branches/prefix/NEWS 2008-02-23 23:33:46 UTC (rev 9373)
190 @@ -10,7 +10,7 @@
191 * Fix -* handling in package.keywords to work as intended (reset the accepted
192 keywords list), also see RELEASE-NOTES.
193 * Experimental support for preserving old library files on package upgrades
194 - based on FEATURES=preserve-libs, USE AT YOUR OWN RISK!!!
195 + based on FEATURES=preserve-libs
196 * Make elog functionality available to python code
197 * Add support for news items (GLEP 42)
198 * Add support for generic package sets (also see RELEASE-NOTES)
199
200 Modified: main/branches/prefix/RELEASE-NOTES
201 ===================================================================
202 --- main/branches/prefix/RELEASE-NOTES 2008-02-23 01:20:48 UTC (rev 9372)
203 +++ main/branches/prefix/RELEASE-NOTES 2008-02-23 23:33:46 UTC (rev 9373)
204 @@ -24,9 +24,13 @@
205 conditionals or any-of constructs aren't possible yet
206 - emerge makes no difference atm wether you pass a setname or all atoms contained
207 in the set to it, this means that without options packages will be remerged if
208 - already installed and added to the worldfile, or in the case of --unmerge all
209 - atoms in a set will be unmerged even if they are depended upon by other
210 - packages
211 + already installed, or in the case of --unmerge all atoms in a set will be
212 + unmerged even if they are depended upon by other packages. This may change in
213 + future versions.
214 + - sets can be referenced either in other file-based sets or as argument to emerge, but
215 + not in ebuilds, config files or other tools at this time.
216 +* "world" does no longer include "system" unconditionally, but you can add
217 + "@system" to the worldfile to restore the old state.
218
219 portage-2.1.4.1
220 ==================================
221
222 Modified: main/branches/prefix/bin/ebuild.sh
223 ===================================================================
224 --- main/branches/prefix/bin/ebuild.sh 2008-02-23 01:20:48 UTC (rev 9372)
225 +++ main/branches/prefix/bin/ebuild.sh 2008-02-23 23:33:46 UTC (rev 9373)
226 @@ -1586,14 +1586,6 @@
227 # source ${X} || die "Failed to source ${X}"
228 # done
229
230 -else
231 -
232 -killparent() {
233 - trap INT
234 - kill ${PORTAGE_MASTER_PID}
235 -}
236 -trap "killparent" INT
237 -
238 fi # "$*"!="depend" && "$*"!="clean" && "$*" != "setup"
239
240 export SANDBOX_ON="1"
241
242 Modified: main/branches/prefix/bin/isolated-functions.sh
243 ===================================================================
244 --- main/branches/prefix/bin/isolated-functions.sh 2008-02-23 01:20:48 UTC (rev 9372)
245 +++ main/branches/prefix/bin/isolated-functions.sh 2008-02-23 23:33:46 UTC (rev 9373)
246 @@ -467,7 +467,7 @@
247 abort_test abort_install dyn_compile dyn_test dyn_install \
248 dyn_preinst dyn_help debug-print debug-print-function \
249 debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \
250 - newpdepend do_newdepend remove_path_entry killparent \
251 + newpdepend do_newdepend remove_path_entry \
252 save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
253 source_all_bashrcs ebuild_phase ebuild_phase_with_hooks \
254 ${QA_INTERCEPTORS}
255
256 Modified: main/branches/prefix/bin/repoman
257 ===================================================================
258 --- main/branches/prefix/bin/repoman 2008-02-23 01:20:48 UTC (rev 9372)
259 +++ main/branches/prefix/bin/repoman 2008-02-23 23:33:46 UTC (rev 9373)
260 @@ -1680,10 +1680,10 @@
261 try:
262 editor = os.environ.get("EDITOR")
263 if editor and utilities.editor_is_executable(editor):
264 - commitmessage = utilties.get_commit_message_with_editor(
265 + commitmessage = utilities.get_commit_message_with_editor(
266 editor, message=qa_output)
267 else:
268 - commitmessage = utilties.get_commit_message_with_stdin()
269 + commitmessage = utilities.get_commit_message_with_stdin()
270 except KeyboardInterrupt:
271 exithandler()
272 if not commitmessage or not commitmessage.strip():
273
274 Modified: main/branches/prefix/cnf/make.conf
275 ===================================================================
276 --- main/branches/prefix/cnf/make.conf 2008-02-23 01:20:48 UTC (rev 9372)
277 +++ main/branches/prefix/cnf/make.conf 2008-02-23 23:33:46 UTC (rev 9373)
278 @@ -278,6 +278,9 @@
279 # 'notitles' disables xterm titlebar updates (which contain status info).
280 # 'parallel-fetch'
281 # do fetching in parallel to compilation
282 +# 'preserve-libs'
283 +# keep libraries around that would normally removed by an upgrade,
284 +# but are still needed by other packages
285 # 'sandbox' enables sandboxing when running emerge and ebuild.
286 # 'splitdebug' Prior to stripping ELF etdyn and etexec files, the debugging
287 # info is stored for later use by various debuggers. This
288
289 Modified: main/branches/prefix/cnf/make.conf.sparc-fbsd.diff
290 ===================================================================
291 --- main/branches/prefix/cnf/make.conf.sparc-fbsd.diff 2008-02-23 01:20:48 UTC (rev 9372)
292 +++ main/branches/prefix/cnf/make.conf.sparc-fbsd.diff 2008-02-23 23:33:46 UTC (rev 9373)
293 @@ -23,10 +23,10 @@
294
295 # Portage Directories
296 # ===================
297 -@@ -279,7 +286,8 @@
298 - # 'notitles' disables xterm titlebar updates (which contain status info).
299 - # 'parallel-fetch'
300 - # do fetching in parallel to compilation
301 +@@ -272,7 +286,8 @@
302 + # 'preserve-libs'
303 + # keep libraries around that would normally removed by an upgrade,
304 + # but are still needed by other packages
305 -# 'sandbox' enables sandboxing when running emerge and ebuild.
306 +# 'sandbox' enables sandboxing when running emerge and ebuild. Doesn't
307 +# work on *BSD-based systems.
308
309 Modified: main/branches/prefix/cnf/make.conf.x86-fbsd.diff
310 ===================================================================
311 --- main/branches/prefix/cnf/make.conf.x86-fbsd.diff 2008-02-23 01:20:48 UTC (rev 9372)
312 +++ main/branches/prefix/cnf/make.conf.x86-fbsd.diff 2008-02-23 23:33:46 UTC (rev 9373)
313 @@ -63,10 +63,10 @@
314
315 # Portage Directories
316 # ===================
317 -@@ -279,7 +313,8 @@
318 - # 'notitles' disables xterm titlebar updates (which contain status info).
319 - # 'parallel-fetch'
320 - # do fetching in parallel to compilation
321 +@@ -272,7 +313,8 @@
322 + # 'preserve-libs'
323 + # keep libraries around that would normally removed by an upgrade,
324 + # but are still needed by other packages
325 -# 'sandbox' enables sandboxing when running emerge and ebuild.
326 +# 'sandbox' enables sandboxing when running emerge and ebuild. Doesn't
327 +# work on *BSD-based systems.
328
329 Deleted: main/branches/prefix/make-man-tarball.sh
330 ===================================================================
331 --- main/branches/prefix/make-man-tarball.sh 2008-02-23 01:20:48 UTC (rev 9372)
332 +++ main/branches/prefix/make-man-tarball.sh 2008-02-23 23:33:46 UTC (rev 9373)
333 @@ -1,13 +0,0 @@
334 -#!/bin/bash
335 -
336 -if [ -z "$1" ] ; then
337 - echo "Usage: $0 <version>"
338 - exit 1
339 -fi
340 -
341 -find man -name '*.eclass.5' > man-page-list
342 -tar -jcf portage-manpages-${1}.tar.bz2 --files-from man-page-list
343 -echo "Packed away $(wc -l man-page-list | cut -f1 -d' ') manpages"
344 -rm -f man-page-list
345 -
346 -ls -l portage-manpages-${1}.tar.bz2
347
348 Modified: main/branches/prefix/man/ebuild.5
349 ===================================================================
350 --- main/branches/prefix/man/ebuild.5 2008-02-23 01:20:48 UTC (rev 9372)
351 +++ main/branches/prefix/man/ebuild.5 2008-02-23 23:33:46 UTC (rev 9373)
352 @@ -727,7 +727,8 @@
353 .PD 1
354 .TP
355 \fBdosed\fR \fI"s:orig:change:g" <filename>\fR
356 -Performs sed in place on \fIfilename\fR inside ${D}.
357 +Performs sed in place on \fIfilename\fR inside ${D}. If no expression is
358 +given then \fI"s:${D}::g"\fR is used as the default expression.
359 .br
360 .BR 'dosed\ "s:/usr/local:/usr:g"\ /usr/bin/some\-script'
361 runs sed on ${D}/usr/bin/some\-script
362
363 Modified: main/branches/prefix/man/emerge.1
364 ===================================================================
365 --- main/branches/prefix/man/emerge.1 2008-02-23 01:20:48 UTC (rev 9372)
366 +++ main/branches/prefix/man/emerge.1 2008-02-23 23:33:46 UTC (rev 9373)
367 @@ -4,7 +4,7 @@
368 .SH "SYNOPSIS"
369 .TP
370 .BR emerge
371 -[\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2file\fR | \fIset\fR | \fIatom\fR] ...
372 +[\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2file\fR | \fI@set\fR | \fIatom\fR] ...
373 .TP
374 .BR emerge
375 \fB\-\-sync\fR | \fB\-\-version\fR
376 @@ -52,13 +52,15 @@
377 .TP
378 .BR set
379 A \fIset\fR is a convenient shorthand for a large group of
380 -packages. Two sets are currently supported: \fBsystem\fR
381 +packages. Two sets are currently always available: \fBsystem\fR
382 and \fBworld\fR. \fBsystem\fR refers to a set of packages
383 -deemed necessary for your system to run properly. \fBworld\fR
384 -contains all the packages in \fBsystem\fR, plus any
385 -other packages listed in \fB/var/lib/portage/world\fR. [See
386 -\fBFILES\fR below for more information.] Note that a \fIset\fR
387 -is generally used in conjunction with \fB\-\-update\fR.
388 +deemed necessary for your system to run properly. \fBworld\fR
389 +contains all the packages listed in \fB/var/lib/portage/world\fR. [See
390 +\fBFILES\fR below for more information.] Other sets can exist depending
391 +on the current configuration. Note that a \fIset\fR
392 +is generally used in conjunction with \fB\-\-update\fR. When used as
393 +arguments to \fBemerge\fR sets have to be prefixed with \fB@\fR to be
394 +recognized.
395 .TP
396 .BR atom
397 An \fIatom\fR describes bounds on a package that you wish to install.
398
399 Modified: main/branches/prefix/pym/_emerge/__init__.py
400 ===================================================================
401 --- main/branches/prefix/pym/_emerge/__init__.py 2008-02-23 01:20:48 UTC (rev 9372)
402 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-02-23 23:33:46 UTC (rev 9373)
403 @@ -665,6 +665,7 @@
404 myversion = self.getVersion(full_package, search.VERSION_RELEASE)
405
406 mysum = [0,0]
407 + file_size_str = None
408 mycat = match.split("/")[0]
409 mypkg = match.split("/")[1]
410 mycpv = match + "-" + myversion
411 @@ -679,7 +680,7 @@
412 try:
413 mysum[0] = mf.getDistfilesSize(fetchlist)
414 except KeyError, e:
415 - mysum[0] = "Unknown (missing digest for %s)" % \
416 + file_size_str = "Unknown (missing digest for %s)" % \
417 str(e)
418
419 available = False
420 @@ -695,13 +696,13 @@
421 myebuild = None
422 break
423
424 - if myebuild:
425 + if myebuild and file_size_str is None:
426 mystr = str(mysum[0] / 1024)
427 mycount = len(mystr)
428 while (mycount > 3):
429 mycount -= 3
430 mystr = mystr[:mycount] + "," + mystr[mycount:]
431 - mysum[0] = mystr + " kB"
432 + file_size_str = mystr + " kB"
433
434 if self.verbose:
435 if available:
436 @@ -709,7 +710,7 @@
437 print " ", self.getInstallationStatus(mycat+'/'+mypkg)
438 if myebuild:
439 print " %s %s" % \
440 - (darkgreen("Size of files:"), mysum[0])
441 + (darkgreen("Size of files:"), file_size_str)
442 print " ", darkgreen("Homepage:")+" ",homepage
443 print " ", darkgreen("Description:")+" ",desc
444 print " ", darkgreen("License:")+" ",license
445 @@ -1043,7 +1044,7 @@
446 return False
447 if not portage.eapi_is_supported(metadata["EAPI"]):
448 return False
449 - if pkgsettings.getMissingKeywords(cpv, metadata):
450 + if not installed and pkgsettings.getMissingKeywords(cpv, metadata):
451 return False
452 if pkgsettings.getMaskAtom(cpv, metadata):
453 return False
454 @@ -1053,6 +1054,97 @@
455 return False
456 return True
457
458 +def get_masking_status(pkg, pkgsettings, root_config):
459 +
460 + mreasons = portage.getmaskingstatus(
461 + pkg, settings=pkgsettings,
462 + portdb=root_config.trees["porttree"].dbapi)
463 +
464 + if pkg.built and not pkg.installed and \
465 + pkg.metadata["CHOST"] != root_config.settings["CHOST"]:
466 + mreasons.append("CHOST: %s" % \
467 + pkg.metadata["CHOST"])
468 +
469 + if pkg.built and not pkg.installed:
470 + if not "EPREFIX" in metadata or not metadata["EPREFIX"]:
471 + mreasons.append("missing EPREFIX")
472 + elif len(metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]):
473 + mreasons.append("EPREFIX: '%s' too small" % metadata["EPREFIX"])
474 +
475 + if not pkg.metadata["SLOT"]:
476 + mreasons.append("invalid: SLOT is undefined")
477 +
478 + return mreasons
479 +
480 +def get_mask_info(root_config, cpv, pkgsettings,
481 + db, pkg_type, built, installed, db_keys):
482 + eapi_masked = False
483 + try:
484 + metadata = dict(izip(db_keys,
485 + db.aux_get(cpv, db_keys)))
486 + except KeyError:
487 + metadata = None
488 + if metadata and not built:
489 + pkgsettings.setcpv(cpv, mydb=metadata)
490 + metadata["USE"] = pkgsettings.get("USE", "")
491 + if metadata is None:
492 + mreasons = ["corruption"]
493 + else:
494 + pkg = Package(type_name=pkg_type, root=root_config.root,
495 + cpv=cpv, built=built, installed=installed, metadata=metadata)
496 + mreasons = get_masking_status(pkg, pkgsettings, root_config)
497 + return metadata, mreasons
498 +
499 +def show_masked_packages(masked_packages):
500 + shown_licenses = set()
501 + shown_comments = set()
502 + # Maybe there is both an ebuild and a binary. Only
503 + # show one of them to avoid redundant appearance.
504 + shown_cpvs = set()
505 + have_eapi_mask = False
506 + for (root_config, pkgsettings, cpv,
507 + metadata, mreasons) in masked_packages:
508 + if cpv in shown_cpvs:
509 + continue
510 + shown_cpvs.add(cpv)
511 + comment, filename = None, None
512 + if "package.mask" in mreasons:
513 + comment, filename = \
514 + portage.getmaskingreason(
515 + cpv, metadata=metadata,
516 + settings=pkgsettings,
517 + portdb=root_config.trees["porttree"].dbapi,
518 + return_location=True)
519 + missing_licenses = []
520 + if metadata:
521 + if not portage.eapi_is_supported(metadata["EAPI"]):
522 + have_eapi_mask = True
523 + try:
524 + missing_licenses = \
525 + pkgsettings.getMissingLicenses(
526 + cpv, metadata)
527 + except portage.exception.InvalidDependString:
528 + # This will have already been reported
529 + # above via mreasons.
530 + pass
531 +
532 + print "- "+cpv+" (masked by: "+", ".join(mreasons)+")"
533 + if comment and comment not in shown_comments:
534 + print filename+":"
535 + print comment
536 + shown_comments.add(comment)
537 + portdb = root_config.trees["porttree"].dbapi
538 + for l in missing_licenses:
539 + l_path = portdb.findLicensePath(l)
540 + if l in shown_licenses:
541 + continue
542 + msg = ("A copy of the '%s' license" + \
543 + " is located at '%s'.") % (l, l_path)
544 + print msg
545 + print
546 + shown_licenses.add(l)
547 + return have_eapi_mask
548 +
549 def iter_atoms(deps):
550 """Take a dependency structure as returned by paren_reduce or use_reduce
551 and iterate over all the atoms."""
552 @@ -1415,6 +1507,7 @@
553 self._altlist_cache = {}
554 self._pprovided_args = []
555 self._missing_args = []
556 + self._masked_installed = []
557 self._dep_stack = []
558 self._unsatisfied_deps = []
559 self._ignored_deps = []
560 @@ -1610,15 +1703,18 @@
561 pkgsettings = self.pkgsettings[pkg.root]
562
563 args = None
564 + arg_atoms = None
565 if True:
566 try:
567 - args = list(self._iter_args_for_pkg(pkg))
568 + arg_atoms = list(self._iter_atoms_for_pkg(pkg))
569 except portage.exception.InvalidDependString, e:
570 if not pkg.installed:
571 show_invalid_depstring_notice(
572 pkg, pkg.metadata["PROVIDE"], str(e))
573 return 0
574 del e
575 + else:
576 + args = [arg for arg, atom in arg_atoms]
577
578 if not pkg.onlydeps:
579 if not pkg.installed and \
580 @@ -1698,6 +1794,32 @@
581 del e
582 return 0
583
584 + if pkg.installed:
585 + # Warn if all matching ebuilds are masked or
586 + # the installed package itself is masked. Do
587 + # not warn if there are simply no matching
588 + # ebuilds since that would be annoying in some
589 + # cases:
590 + #
591 + # - binary packages installed from an overlay
592 + # that is not listed in PORTDIR_OVERLAY
593 + #
594 + # - multi-slot atoms listed in the world file
595 + # to prevent depclean from removing them
596 +
597 + if arg_atoms:
598 + portdb = self.trees[pkg.root]["porttree"].dbapi
599 + for arg, atom in arg_atoms:
600 + all_ebuilds_masked = bool(
601 + portdb.xmatch("match-all", atom) and
602 + not portdb.xmatch("bestmatch-visible", atom))
603 + if all_ebuilds_masked:
604 + self._missing_args.append((arg, atom))
605 +
606 + if not visible(pkgsettings, pkg.cpv, pkg.metadata,
607 + built=pkg.built, installed=pkg.installed):
608 + self._masked_installed.append((pkg, pkgsettings))
609 +
610 if args:
611 self._set_nodes.add(pkg)
612
613 @@ -1874,6 +1996,18 @@
614 continue
615 yield arg
616
617 + def _iter_atoms_for_pkg(self, pkg):
618 + # TODO: add multiple $ROOT support
619 + if pkg.root != self.target_root:
620 + return
621 + atom_arg_map = self._atom_arg_map
622 + for atom in self._set_atoms.iterAtomsForPackage(pkg):
623 + for arg in atom_arg_map[(atom, pkg.root)]:
624 + if isinstance(arg, PackageArg) and \
625 + arg.package != pkg:
626 + continue
627 + yield arg, atom
628 +
629 def _get_arg_for_pkg(self, pkg):
630 """
631 Return a matching DependencyArg instance for the given Package if
632 @@ -2110,34 +2244,10 @@
633 return 0, myfavorites
634 self._missing_args.append((arg, atom))
635 continue
636 - if pkg.installed:
637 - # Warn if all matching ebuilds are masked or
638 - # the installed package itself is masked. Do
639 - # not warn if there are simply no matching
640 - # ebuilds since that would be annoying in some
641 - # cases:
642 - #
643 - # - binary packages installed from an overlay
644 - # that is not listed in PORTDIR_OVERLAY
645 - #
646 - # - multi-slot atoms listed in the world file
647 - # to prevent depclean from removing them
648 + if pkg.installed and "selective" not in self.myparams:
649 + self._show_unsatisfied_dep(myroot, atom)
650 + return 0, myfavorites
651
652 - installed_masked = not visible(
653 - pkgsettings, pkg.cpv, pkg.metadata,
654 - built=pkg.built, installed=pkg.installed)
655 -
656 - all_ebuilds_masked = bool(
657 - portdb.xmatch("match-all", atom) and
658 - not portdb.xmatch("bestmatch-visible", atom))
659 -
660 - if installed_masked or all_ebuilds_masked:
661 - self._missing_args.append((arg, atom))
662 -
663 - if "selective" not in self.myparams:
664 - self._show_unsatisfied_dep(myroot, atom)
665 - return 0, myfavorites
666 -
667 self._dep_stack.append(
668 Dependency(atom=atom, root=myroot, parent=arg))
669 if not self._create_graph():
670 @@ -2360,9 +2470,9 @@
671 red(' [%s]' % myparent[0]) + ')'
672 masked_packages = []
673 missing_licenses = []
674 - from textwrap import wrap
675 have_eapi_mask = False
676 pkgsettings = self.pkgsettings[root]
677 + root_config = self.roots[root]
678 portdb = self.roots[root].trees["porttree"].dbapi
679 dbs = self._filtered_trees[root]["dbs"]
680 for db, pkg_type, built, installed, db_keys in dbs:
681 @@ -2374,81 +2484,15 @@
682 # descending order
683 cpv_list.reverse()
684 for cpv in cpv_list:
685 - try:
686 - metadata = dict(izip(db_keys,
687 - db.aux_get(cpv, db_keys)))
688 - except KeyError:
689 - mreasons = ["corruption"]
690 - metadata = None
691 - if metadata and not built:
692 - if "?" in metadata["LICENSE"]:
693 - pkgsettings.setcpv(cpv, mydb=portdb)
694 - metadata["USE"] = pkgsettings.get("USE", "")
695 - else:
696 - metadata["USE"] = ""
697 - mreasons = portage.getmaskingstatus(
698 - cpv, metadata=metadata,
699 - settings=pkgsettings, portdb=portdb)
700 - comment, filename = None, None
701 - if "package.mask" in mreasons:
702 - comment, filename = \
703 - portage.getmaskingreason(
704 - cpv, metadata=metadata,
705 - settings=pkgsettings, portdb=portdb,
706 - return_location=True)
707 - if built and \
708 - metadata["CHOST"] != pkgsettings["CHOST"]:
709 - mreasons.append("CHOST: %s" % \
710 - metadata["CHOST"])
711 - if built:
712 - if not "EPREFIX" in metadata or not metadata["EPREFIX"]:
713 - mreasons.append("missing EPREFIX")
714 - elif len(metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]):
715 - mreasons.append("EPREFIX: '%s' too small" % metadata["EPREFIX"])
716 - missing_licenses = []
717 - if metadata:
718 - if not metadata["SLOT"]:
719 - mreasons.append("invalid: SLOT is undefined")
720 - if not portage.eapi_is_supported(metadata["EAPI"]):
721 - have_eapi_mask = True
722 - try:
723 - missing_licenses = \
724 - pkgsettings.getMissingLicenses(
725 - cpv, metadata)
726 - except portage.exception.InvalidDependString:
727 - # This will have already been reported
728 - # above via mreasons.
729 - pass
730 - if not mreasons:
731 - continue
732 - masked_packages.append((cpv, mreasons,
733 - comment, filename, missing_licenses))
734 + metadata, mreasons = get_mask_info(root_config, cpv,
735 + pkgsettings, db, pkg_type, built, installed, db_keys)
736 + masked_packages.append(
737 + (root_config, pkgsettings, cpv, metadata, mreasons))
738 +
739 if masked_packages:
740 print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
741 print "!!! One of the following masked packages is required to complete your request:"
742 - shown_licenses = set()
743 - shown_comments = set()
744 - # Maybe there is both an ebuild and a binary. Only
745 - # show one of them to avoid redundant appearance.
746 - shown_cpvs = set()
747 - for cpv, mreasons, comment, filename, missing_licenses in masked_packages:
748 - if cpv in shown_cpvs:
749 - continue
750 - shown_cpvs.add(cpv)
751 - print "- "+cpv+" (masked by: "+", ".join(mreasons)+")"
752 - if comment and comment not in shown_comments:
753 - print filename+":"
754 - print comment
755 - shown_comments.add(comment)
756 - for l in missing_licenses:
757 - l_path = portdb.findLicensePath(l)
758 - if l in shown_licenses:
759 - continue
760 - msg = ("A copy of the '%s' license" + \
761 - " is located at '%s'.") % (l, l_path)
762 - print msg
763 - print
764 - shown_licenses.add(l)
765 + have_eapi_mask = show_masked_packages(masked_packages)
766 if have_eapi_mask:
767 if portage.const.EAPIPREFIX:
768 p = portage.const.EAPIPREFIX + " "
769 @@ -2459,6 +2503,7 @@
770 "EAPI '%s%s'. You must upgrade to a newer version" + \
771 " of portage before EAPI masked packages can" + \
772 " be installed.") % (p, portage.const.EAPI)
773 + from textwrap import wrap
774 for line in wrap(msg, 75):
775 print line
776 print
777 @@ -3947,6 +3992,18 @@
778
779 # TODO: Add generic support for "set problem" handlers so that
780 # the below warnings aren't special cases for world only.
781 +
782 + masked_packages = []
783 + for pkg, pkgsettings in self._masked_installed:
784 + root_config = self.roots[pkg.root]
785 + mreasons = get_masking_status(pkg, pkgsettings, root_config)
786 + masked_packages.append((root_config, pkgsettings,
787 + pkg.cpv, pkg.metadata, mreasons))
788 + if masked_packages:
789 + sys.stderr.write("\n" + colorize("BAD", "!!!") + \
790 + " The following installed packages are masked:\n")
791 + show_masked_packages(masked_packages)
792 +
793 if self._missing_args:
794 world_problems = False
795 if "world" in self._sets:
796 @@ -3961,6 +4018,7 @@
797 sys.stderr.write("!!! Please run " + \
798 green("emaint --check world")+"\n\n")
799
800 + if self._missing_args:
801 sys.stderr.write("\n" + colorize("BAD", "!!!") + \
802 " Ebuilds for the following packages are either all\n")
803 sys.stderr.write(colorize("BAD", "!!!") + \
804 @@ -5556,6 +5614,8 @@
805 ("-6" in all_rsync_opts or "--ipv6" in all_rsync_opts):
806 family = socket.AF_INET6
807 ips=[]
808 + SERVER_OUT_OF_DATE = -1
809 + EXCEEDED_MAX_RETRIES = -2
810 while (1):
811 if ips:
812 del ips[0]
813 @@ -5697,7 +5757,7 @@
814 print ">>> In order to force sync, remove '%s'." % servertimestampfile
815 print ">>>"
816 print
817 - exitcode = 1
818 + exitcode = SERVER_OUT_OF_DATE
819 elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
820 # actual sync
821 mycommand = rsynccommand + [dosyncuri+"/", myportdir]
822 @@ -5723,10 +5783,17 @@
823 # over retries
824 # exit loop
825 updatecache_flg=False
826 + exitcode = EXCEEDED_MAX_RETRIES
827 break
828
829 if (exitcode==0):
830 emergelog(xterm_titles, "=== Sync completed with %s" % dosyncuri)
831 + elif exitcode == SERVER_OUT_OF_DATE:
832 + sys.exit(1)
833 + elif exitcode == EXCEEDED_MAX_RETRIES:
834 + sys.stderr.write(
835 + ">>> Exceeded PORTAGE_RSYNC_RETRIES: %s\n" % maxretries)
836 + sys.exit(1)
837 elif (exitcode>0):
838 print
839 if exitcode==1:
840
841 Modified: main/branches/prefix/pym/portage/__init__.py
842 ===================================================================
843 --- main/branches/prefix/pym/portage/__init__.py 2008-02-23 01:20:48 UTC (rev 9372)
844 +++ main/branches/prefix/pym/portage/__init__.py 2008-02-23 23:33:46 UTC (rev 9373)
845 @@ -5741,11 +5741,21 @@
846 else:
847 return None
848
849 -def getmaskingstatus(mycpv, metadata=None, settings=None, portdb=None):
850 +def getmaskingstatus(mycpv, settings=None, portdb=None):
851 if settings is None:
852 settings = config(clone=globals()["settings"])
853 if portdb is None:
854 portdb = globals()["portdb"]
855 +
856 + metadata = None
857 + installed = False
858 + if not isinstance(mycpv, basestring):
859 + # emerge passed in a Package instance
860 + pkg = mycpv
861 + mycpv = pkg.cpv
862 + metadata = pkg.metadata
863 + installed = pkg.installed
864 +
865 mysplit = catpkgsplit(mycpv)
866 if not mysplit:
867 raise ValueError("invalid CPV: %s" % mycpv)
868 @@ -5835,7 +5845,9 @@
869 kmask="~"+myarch
870 break
871
872 - if kmask:
873 + # Assume that the user doesn't want to be bothered about
874 + # KEYWORDS of packages that are already installed.
875 + if kmask and not installed:
876 rValue.append(kmask+" keyword")
877
878 try:
879
880 Modified: main/branches/prefix/pym/repoman/utilities.py
881 ===================================================================
882 --- main/branches/prefix/pym/repoman/utilities.py 2008-02-23 01:20:48 UTC (rev 9372)
883 +++ main/branches/prefix/pym/repoman/utilities.py 2008-02-23 23:33:46 UTC (rev 9373)
884 @@ -13,13 +13,14 @@
885 import sys
886
887 from portage import output
888 +from portage.output import red, green
889 from portage import exception
890 from portage import util
891 normalize_path = util.normalize_path
892 util.initialize_logger()
893
894
895 -def detect_vcs_conflicts(vcs, options):
896 +def detect_vcs_conflicts(options, vcs):
897 """Determine if the checkout has problems like cvs conflicts.
898
899 If you want more vcs support here just keep adding if blocks...
900
901 Modified: main/branches/prefix/tarball.sh
902 ===================================================================
903 --- main/branches/prefix/tarball.sh 2008-02-23 01:20:48 UTC (rev 9372)
904 +++ main/branches/prefix/tarball.sh 2008-02-23 23:33:46 UTC (rev 9373)
905 @@ -1,5 +1,5 @@
906 #!/usr/bin/env bash
907 -# $Id: $
908 +# $Id$
909
910 if [ -z "$1" ]; then
911 echo
912
913
914 Property changes on: main/branches/prefix/tarball.sh
915 ___________________________________________________________________
916 Name: svn:keywords
917 + Id
918
919 --
920 gentoo-commits@l.g.o mailing list