comparison sources/control-images/gentoo-bootstrap/patches/portage-2.1.8.3.patch @ 1275:a4cb2ed0a551

Move sources/native-builds to sources/control-images, so the naming is consistent.
author Rob Landley <rob@landley.net>
date Sun, 07 Nov 2010 15:55:26 -0600
parents sources/native-builds/gentoo-bootstrap/patches/portage-2.1.8.3.patch@204238871b7c
children
comparison
equal deleted inserted replaced
1274:b41dbea3ba14 1275:a4cb2ed0a551
1 Index: ChangeLog
2 ===================================================================
3 --- a/ChangeLog (revision 15731)
4 +++ b/ChangeLog (revision 15814)
5 @@ -1,3 +1,178 @@
6 +2010-03-10 00:31 zmedico
7 +
8 + * [r15814] pym/_emerge/depgraph.py: Only try to merge portage asap
9 + when the new version is different. (trunk r15813)
10 +
11 +2010-03-09 21:27 zmedico
12 +
13 + * [r15812] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py: Only
14 + create implicit libc deps when the version changes. (trunk
15 + r15810)
16 +
17 +2010-03-09 21:25 zmedico
18 +
19 + * [r15811] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py:
20 + Disable implicit libc deps for ROOT != "/" since it's probably
21 + not needed. (trunk r15809)
22 +
23 +2010-03-09 20:21 zmedico
24 +
25 + * [r15808] pym/_emerge/depgraph.py: Merge libc asap for all roots
26 + instead of just ROOT="/". (trunk r15804)
27 +
28 +2010-03-09 20:21 zmedico
29 +
30 + * [r15807] pym/_emerge/sync/old_tree_timestamp.py: Add periods.
31 + (trunk r15803)
32 +
33 +2010-03-09 20:20 zmedico
34 +
35 + * [r15806] pym/_emerge/sync/old_tree_timestamp.py: Use ewarn output
36 + style to add some color. (trunk r15802)
37 +
38 +2010-03-09 20:20 zmedico
39 +
40 + * [r15805] man/portage.5: * Remove outdated profiles.desc sentence
41 + about "1 profile allowed per stable/dev/KEYWORD". Thanks to
42 + Torsten Veller <tove@g.o> for reporting.
43 +
44 + * Add 'exp' to valid profiles.desc status values, and update the
45 + example. (trunk r15795)
46 +
47 +2010-03-09 08:11 zmedico
48 +
49 + * [r15794] pym/portage/mail.py: Import 'email' and 'smtlib' locally
50 + since python ebuilds remove the 'email' module when built with
51 + USE=build. (trunk r15793)
52 +
53 +2010-03-09 05:04 zmedico
54 +
55 + * [r15792] pym/_emerge/Scheduler.py: Add --debug output for the
56 + scheduler digraph. (trunk r15790)
57 +
58 +2010-03-09 05:04 zmedico
59 +
60 + * [r15791] pym/_emerge/Scheduler.py: If _implicit_libc_deps() finds
61 + both a new-style virtual and an old-style PROVIDE virtual, use
62 + the new-style virtual. (trunk r15789)
63 +
64 +2010-03-09 04:31 zmedico
65 +
66 + * [r15788] pym/_emerge/actions.py: Add support for displaying
67 + profile listed in make.profile/parent when make.profile is not a
68 + symlink. The first parent with a path inside $PORTDIR is
69 + displayed. (trunk r15787)
70 +
71 +2010-03-09 03:59 zmedico
72 +
73 + * [r15786] pym/_emerge/Scheduler.py: Fix typo in parenthesis from
74 + previous commit. (trunk r15784)
75 +
76 +2010-03-09 03:58 zmedico
77 +
78 + * [r15785] pym/_emerge/Scheduler.py: Bug #303567 - Create implicit
79 + dependencies on libc, in order to ensure that libc is installed
80 + as early as possible. (trunk r15783)
81 +
82 +2010-03-09 02:42 zmedico
83 +
84 + * [r15782] pym/portage/dbapi/vartree.py,
85 + pym/portage/proxy/lazyimport.py: When portage upgrades or
86 + downgrades itself, preload lazily referenced portage submodules
87 + into memory so that imports won't fail later. (trunk r15778)
88 +
89 +2010-03-09 02:42 zmedico
90 +
91 + * [r15781] man/emerge.1, pym/_emerge/help.py: Move --update from
92 + the actions to the options section. (trunk r15777)
93 +
94 +2010-03-09 02:42 zmedico
95 +
96 + * [r15780] man/emerge.1, pym/_emerge/help.py: Clean up/sync docs
97 + for emerge --sync, and add a note about PORTAGE_SYNC_STALE.
98 + (trunk r15776)
99 +
100 +2010-03-09 02:42 zmedico
101 +
102 + * [r15779] man/emerge.1: Escape hyphens. (trunk r15775)
103 +
104 +2010-03-08 09:40 zmedico
105 +
106 + * [r15772] pym/_emerge/sync/__init__.py: Add copyright header.
107 + (trunk r15771)
108 +
109 +2010-03-08 09:10 zmedico
110 +
111 + * [r15770] pym/_emerge/actions.py: Disable PORTAGE_SYNC_STALE
112 + warnings when --usepkgonly is enabled. (trunk r15769)
113 +
114 +2010-03-08 09:05 zmedico
115 +
116 + * [r15768] pym/portage/package/ebuild/config.py: Exclude
117 + PORTAGE_SYNC_STALE from the ebuild environment. (trunk r15767)
118 +
119 +2010-03-08 08:57 zmedico
120 +
121 + * [r15766] pym/_emerge/depgraph.py: Bug #307409 - Force --verbose
122 + mode when displaying circular deps. (trunk r15765)
123 +
124 +2010-03-08 08:47 zmedico
125 +
126 + * [r15764] pym/portage/mail.py: Bug #291331 - Force ascii encoding
127 + in send_mail() in order to avoid UnicodeEncodeError from
128 + smtplib.sendmail with python3. (trunk r15759)
129 +
130 +2010-03-08 08:47 zmedico
131 +
132 + * [r15763] pym/_emerge/sync/old_tree_timestamp.py: Show --sync in
133 + messages, to help avoid confusion. (trunk r15758)
134 +
135 +2010-03-08 08:47 zmedico
136 +
137 + * [r15762] man/make.conf.5: Note that PORTAGE_SYNC_STALE=0 will
138 + disable warnings. (trunk r15757)
139 +
140 +2010-03-08 08:47 zmedico
141 +
142 + * [r15761] cnf/make.globals, man/make.conf.5,
143 + pym/_emerge/actions.py, pym/_emerge/sync: Produce a warning
144 + message if the timestamp of the portage tree is more than 30 days
145 + old, and make it adjustable via the PORTAGE_SYNC_STALE variable.
146 + Thanks to Ned Ludd <solar@g.o> for the most of this code. (trunk
147 + r15756)
148 +
149 +2010-03-08 08:46 zmedico
150 +
151 + * [r15760] pym/portage/package/ebuild/doebuild.py: Bug #308415 -
152 + Fix broken uri parameter passed to fetch () for some cases when
153 + using ebuild(1). (trunk r15755)
154 +
155 +2010-03-04 11:23 zmedico
156 +
157 + * [r15749] pym/portage/package/ebuild/getmaskingstatus.py: Bug
158 + #307723 - Define basestring for python3. (trunk r15745)
159 +
160 +2010-03-04 11:23 zmedico
161 +
162 + * [r15748] pym/portage/package/ebuild/doebuild.py,
163 + pym/portage/package/ebuild/fetch.py: Fix imports
164 + doebuild_environment and prepare_build_dirs imports to import
165 + from the real location instead of importing proxies. (trunk
166 + r15744)
167 +
168 +2010-03-04 11:22 zmedico
169 +
170 + * [r15747] pym/portage/package/ebuild/fetch.py: Bug #307707 - Fix
171 + fetch() to use the correct spawn function when calling nofetch.
172 + (trunk r15743)
173 +
174 +2010-03-04 11:22 zmedico
175 +
176 + * [r15746] man/color.map.5, pym/_emerge/depgraph.py,
177 + pym/portage/output.py: Add new colors for binary packages in the
178 + merge list. Thanks to Sebastian Luther (few) for this patch.
179 + (trunk r15739)
180 +
181 2010-03-03 06:27 zmedico
182
183 * [r15731] NEWS: Add news about splitting the top-level
184 Index: cnf/make.globals
185 ===================================================================
186 --- a/cnf/make.globals (revision 15731)
187 +++ b/cnf/make.globals (revision 15814)
188 @@ -1,6 +1,6 @@
189 # Copyright 1999-2006 Gentoo Foundation
190 # Distributed under the terms of the GNU General Public License v2
191 -# $Id: make.globals 15254 2010-01-29 18:49:10Z zmedico $
192 +# $Id: make.globals 15761 2010-03-08 08:47:02Z zmedico $
193 # System-wide defaults for the Portage system
194
195 # *****************************
196 @@ -80,6 +80,10 @@
197
198 PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
199
200 +# The number of days after the last `emerge --sync` that a warning
201 +# message should be produced.
202 +PORTAGE_SYNC_STALE="30"
203 +
204 # Minimal CONFIG_PROTECT
205 CONFIG_PROTECT="/etc"
206 CONFIG_PROTECT_MASK="/etc/env.d"
207 Index: man/color.map.5
208 ===================================================================
209 --- a/man/color.map.5 (revision 15731)
210 +++ b/man/color.map.5 (revision 15814)
211 @@ -50,6 +50,15 @@
212 \fBPKG_MERGE_WORLD\fR = \fI"green"\fR
213 Defines color used for world packages planned to be merged.
214 .TP
215 +\fBPKG_BINARY_MERGE\fR = \fI"darkgreen"\fR
216 +Defines color used for packages planned to be merged using a binary package.
217 +.TP
218 +\fBPKG_BINARY_MERGE_SYSTEM\fR = \fI"darkgreen"\fR
219 +Defines color used for system packages planned to be merged using a binary package.
220 +.TP
221 +\fBPKG_BINARY_MERGE_WORLD\fR = \fI"green"\fR
222 +Defines color used for world packages planned to be merged using a binary package.
223 +.TP
224 \fBPKG_NOMERGE\fR = \fI"darkblue"\fR
225 Defines color used for packages not planned to be merged.
226 .TP
227 Index: man/emerge.1
228 ===================================================================
229 --- a/man/emerge.1 (revision 15731)
230 +++ b/man/emerge.1 (revision 15814)
231 @@ -195,7 +195,7 @@
232 name starts with "kde"; \fBemerge \-\-search "%gcc$"\fR searches for any
233 package that ends with "gcc"; \fBemerge \-\-search "office"\fR searches for
234 any package that contains the word "office". If you want to include the
235 -category into the search string, prepend an @: \fBemerge --search
236 +category into the search string, prepend an @: \fBemerge \-\-search
237 "%@^dev-java.*jdk"\fR. If you want to search the package descriptions as well,
238 use the \fB\-\-searchdesc\fR action.
239 .TP
240 @@ -205,11 +205,26 @@
241 matched as regular expressions.
242 .TP
243 .BR \-\-sync
244 -Initiates a portage tree update with one of the rsync.gentoo.org
245 -mirrors. \fBNote that any changes you have made to the portage
246 -tree will be erased\fR. Except for special circumstances,
247 -this uses \fBrsync\fR to do the update. See \fBmake.conf\fR(5)'s
248 -description of PORTDIR_OVERLAY for a method to avoid deletions.
249 +This updates the portage tree that is located in the
250 +directory that the PORTDIR variable refers to (default
251 +location is /usr/portage). The SYNC variable specifies
252 +the remote URI from which files will be synchronized.
253 +The \fBPORTAGE_SYNC_STALE\fR variable configures
254 +warnings that are shown when emerge \-\-sync has not
255 +been executed recently.
256 +
257 +\fBWARNING:\fR
258 +The emerge \-\-sync action will modify and/or delete
259 +files located inside the directory that the PORTDIR
260 +variable refers to (default location is /usr/portage).
261 +For more information, see the PORTDIR documentation in
262 +the make.conf(5) man page.
263 +
264 +\fBNOTE:\fR
265 +The \fBemerge\-webrsync\fR program will download the entire
266 +portage tree as a tarball, which is much faster than emerge
267 +\-\-sync for first time syncs.
268 +
269 .TP
270 .BR "\-\-unmerge " (\fB\-C\fR)
271 \fBWARNING: This action can remove important packages!\fR Removes
272 @@ -219,13 +234,6 @@
273 \fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
274 use \fB\-\-depclean\fR or \fB\-\-prune\fR.
275 .TP
276 -.BR "\-\-update " (\fB\-u\fR)
277 -Updates packages to the best version available, which may not always be the
278 -highest version number due to masking for testing and development.
279 -Package atoms
280 -specified on the command line are greedy, meaning that unspecific atoms may
281 -match multiple installed versions of slotted packages.
282 -.TP
283 .BR "\-\-version " (\fB\-V\fR)
284 Displays the version number of \fBemerge\fR.
285 .SH "OPTIONS"
286 @@ -536,6 +544,13 @@
287 constraint is removed, hopefully leading to a more
288 readable dependency tree.
289 .TP
290 +.BR "\-\-update " (\fB\-u\fR)
291 +Updates packages to the best version available, which may
292 +not always be the highest version number due to masking
293 +for testing and development. Package atoms specified on
294 +the command line are greedy, meaning that unspecific
295 +atoms may match multiple versions of slotted packages.
296 +.TP
297 .BR "\-\-use\-ebuild\-visibility[=n]"
298 Use unbuilt ebuild metadata for visibility
299 checks on built packages.
300 Index: man/make.conf.5
301 ===================================================================
302 --- a/man/make.conf.5 (revision 15731)
303 +++ b/man/make.conf.5 (revision 15814)
304 @@ -639,6 +639,12 @@
305 .br
306 Defaults to 3.
307 .TP
308 +\fBPORTAGE_SYNC_STALE\fR = \fI[NUMBER]\fR
309 +Defines the number of days after the last `emerge \-\-sync` that a warning
310 +message should be produced. A value of 0 will disable warnings.
311 +.br
312 +Defaults to 30.
313 +.TP
314 \fBPORTAGE_TMPDIR\fR = \fI[path]\fR
315 Defines the location of the temporary build directories.
316 .br
317 Index: man/portage.5
318 ===================================================================
319 --- a/man/portage.5 (revision 15731)
320 +++ b/man/portage.5 (revision 15814)
321 @@ -751,23 +751,22 @@
322 .TP
323 .BR profiles.desc
324 List all the current stable and development profiles. If a profile is listed
325 -here, then it will be checked by repoman. At the moment, only 1 profile is
326 -allowed per stable/dev/KEYWORD; the last one found is the last one used.
327 -
328 +here, then it will be checked by repoman.
329 .I Format:
330 .nf
331 \- comments begin with # (no inline comments)
332 \- one profile list per line in format: arch dir status
333 \- arch must be listed in arch.list
334 \- dir is relative to profiles.desc
335 -\- status must be 'stable' or 'dev'
336 +\- status must be 'stable', 'dev', or 'exp'
337 .fi
338
339 .I Example:
340 .nf
341 -alpha default-linux/alpha/2004.3 stable
342 -m68k default-linux/m68k dev
343 -x86 default-linux/x86/2004.3 stable
344 +alpha default/linux/alpha/10.0 stable
345 +m68k default/linux/m68k/10.0 dev
346 +x86 default/linux/x86/10.0 stable
347 +x86-linux prefix/linux/x86 exp
348 .fi
349 .TP
350 .BR repo_name
351 Index: pym/_emerge/actions.py
352 ===================================================================
353 --- a/pym/_emerge/actions.py (revision 15731)
354 +++ b/pym/_emerge/actions.py (revision 15814)
355 @@ -1,6 +1,6 @@
356 # Copyright 1999-2009 Gentoo Foundation
357 # Distributed under the terms of the GNU General Public License v2
358 -# $Id: actions.py 15687 2010-03-02 21:07:53Z zmedico $
359 +# $Id: actions.py 15788 2010-03-09 04:31:13Z zmedico $
360
361 from __future__ import print_function
362
363 @@ -53,6 +53,7 @@
364 from _emerge.search import search
365 from _emerge.SetArg import SetArg
366 from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
367 +from _emerge.sync.old_tree_timestamp import old_tree_timestamp_warn
368 from _emerge.unmerge import unmerge
369 from _emerge.UnmergeDepPriority import UnmergeDepPriority
370 from _emerge.UseFlagDisplay import UseFlagDisplay
371 @@ -64,6 +65,9 @@
372 def action_build(settings, trees, mtimedb,
373 myopts, myaction, myfiles, spinner):
374
375 + if '--usepkgonly' not in myopts:
376 + old_tree_timestamp_warn(settings['PORTDIR'], settings)
377 +
378 # validate the state of the resume data
379 # so that we can make assumptions later.
380 for k in ("resume", "resume_backup"):
381 @@ -2249,19 +2253,38 @@
382 writemsg_level("".join("%s\n" % l for l in msg),
383 level=logging.ERROR, noiselevel=-1)
384
385 +def relative_profile_path(portdir, abs_profile):
386 + realpath = os.path.realpath(abs_profile)
387 + basepath = os.path.realpath(os.path.join(portdir, "profiles"))
388 + if realpath.startswith(basepath):
389 + profilever = realpath[1 + len(basepath):]
390 + else:
391 + profilever = None
392 + return profilever
393 +
394 def getportageversion(portdir, target_root, profile, chost, vardb):
395 - profilever = "unavailable"
396 + profilever = None
397 if profile:
398 - realpath = os.path.realpath(profile)
399 - basepath = os.path.realpath(os.path.join(portdir, "profiles"))
400 - if realpath.startswith(basepath):
401 - profilever = realpath[1 + len(basepath):]
402 - else:
403 + profilever = relative_profile_path(portdir, profile)
404 + if profilever is None:
405 try:
406 - profilever = "!" + os.readlink(profile)
407 - except (OSError):
408 + for parent in portage.grabfile(
409 + os.path.join(profile, 'parent')):
410 + profilever = relative_profile_path(portdir,
411 + os.path.join(profile, parent))
412 + if profilever is not None:
413 + break
414 + except portage.exception.PortageException:
415 pass
416 - del realpath, basepath
417 +
418 + if profilever is None:
419 + try:
420 + profilever = "!" + os.readlink(profile)
421 + except (OSError):
422 + pass
423 +
424 + if profilever is None:
425 + profilever = "unavailable"
426
427 libcver=[]
428 libclist = vardb.match("virtual/libc")
429 Index: pym/_emerge/depgraph.py
430 ===================================================================
431 --- a/pym/_emerge/depgraph.py (revision 15731)
432 +++ b/pym/_emerge/depgraph.py (revision 15814)
433 @@ -1,6 +1,6 @@
434 # Copyright 1999-2009 Gentoo Foundation
435 # Distributed under the terms of the GNU General Public License v2
436 -# $Id: depgraph.py 15711 2010-03-02 21:14:20Z zmedico $
437 +# $Id: depgraph.py 15814 2010-03-10 00:31:43Z zmedico $
438
439 from __future__ import print_function
440
441 @@ -3341,7 +3341,9 @@
442 if replacement_portage == running_portage:
443 replacement_portage = None
444
445 - if replacement_portage is not None:
446 + if replacement_portage is not None and \
447 + (running_portage is None or \
448 + (running_portage.cpv != replacement_portage.cpv)):
449 # update from running_portage to replacement_portage asap
450 asap_nodes.append(replacement_portage)
451
452 @@ -3363,12 +3365,16 @@
453
454 # Merge libc asap, in order to account for implicit
455 # dependencies. See bug #303567.
456 - libc_pkg = self._dynamic_config.mydbapi[running_root].match_pkgs(
457 - portage.const.LIBC_PACKAGE_ATOM)
458 - if libc_pkg:
459 - libc_pkg = libc_pkg[0]
460 - if libc_pkg.operation == 'merge':
461 - asap_nodes.append(libc_pkg)
462 + for root in (running_root,):
463 + libc_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
464 + portage.const.LIBC_PACKAGE_ATOM)
465 + if libc_pkg:
466 + libc_pkg = libc_pkg[0]
467 + if libc_pkg.operation == 'merge':
468 + # Only add a dep when the version changes.
469 + if not libc_pkg.root_config.trees[
470 + 'vartree'].dbapi.cpv_exists(libc_pkg.cpv):
471 + asap_nodes.append(libc_pkg)
472
473 def gather_deps(ignore_priority, mergeable_nodes,
474 selected_nodes, node):
475 @@ -3904,7 +3910,7 @@
476 tempgraph.remove(node)
477 display_order.reverse()
478 self._frozen_config.myopts.pop("--quiet", None)
479 - self._frozen_config.myopts.pop("--verbose", None)
480 + self._frozen_config.myopts["--verbose"] = True
481 self._frozen_config.myopts["--tree"] = True
482 portage.writemsg("\n\n", noiselevel=-1)
483 self.display(display_order)
484 @@ -4500,12 +4506,20 @@
485
486 def pkgprint(pkg_str):
487 if pkg_merge:
488 - if pkg_system:
489 - return colorize("PKG_MERGE_SYSTEM", pkg_str)
490 - elif pkg_world:
491 - return colorize("PKG_MERGE_WORLD", pkg_str)
492 + if built:
493 + if pkg_system:
494 + return colorize("PKG_BINARY_MERGE_SYSTEM", pkg_str)
495 + elif pkg_world:
496 + return colorize("PKG_BINARY_MERGE_WORLD", pkg_str)
497 + else:
498 + return colorize("PKG_BINARY_MERGE", pkg_str)
499 else:
500 - return colorize("PKG_MERGE", pkg_str)
501 + if pkg_system:
502 + return colorize("PKG_MERGE_SYSTEM", pkg_str)
503 + elif pkg_world:
504 + return colorize("PKG_MERGE_WORLD", pkg_str)
505 + else:
506 + return colorize("PKG_MERGE", pkg_str)
507 elif pkg_status == "uninstall":
508 return colorize("PKG_UNINSTALL", pkg_str)
509 else:
510 Index: pym/_emerge/help.py
511 ===================================================================
512 --- a/pym/_emerge/help.py (revision 15731)
513 +++ b/pym/_emerge/help.py (revision 15814)
514 @@ -1,6 +1,6 @@
515 # Copyright 1999-2009 Gentoo Foundation
516 # Distributed under the terms of the GNU General Public License v2
517 -# $Id: help.py 15687 2010-03-02 21:07:53Z zmedico $
518 +# $Id: help.py 15781 2010-03-09 02:42:23Z zmedico $
519
520 from __future__ import print_function
521
522 @@ -195,18 +195,31 @@
523 print(" emerge -S 'perl.*module'")
524 print()
525 print(" "+green("--sync"))
526 - print(" Tells emerge to update the Portage tree as specified in")
527 - print(" The SYNC variable found in /etc/make.conf. By default, SYNC instructs")
528 - print(" emerge to perform an rsync-style update with rsync.gentoo.org.")
529 + desc = "This updates the portage tree that is located in the " + \
530 + "directory that the PORTDIR variable refers to (default " + \
531 + "location is /usr/portage). The SYNC variable specifies " + \
532 + "the remote URI from which files will be synchronized. " + \
533 + "The PORTAGE_SYNC_STALE variable configures " + \
534 + "warnings that are shown when emerge --sync has not " + \
535 + "been executed recently."
536 + for line in wrap(desc, desc_width):
537 + print(desc_indent + line)
538 print()
539 - print(" 'emerge-webrsync' exists as a helper app to emerge --sync, providing a")
540 - print(" method to receive the entire portage tree as a tarball that can be")
541 - print(" extracted and used. First time syncs would benefit greatly from this.")
542 + print(desc_indent + turquoise("WARNING:"))
543 + desc = "The emerge --sync action will modify and/or delete " + \
544 + "files located inside the directory that the PORTDIR " + \
545 + "variable refers to (default location is /usr/portage). " + \
546 + "For more information, see the PORTDIR documentation in " + \
547 + "the make.conf(5) man page."
548 + for line in wrap(desc, desc_width):
549 + print(desc_indent + line)
550 print()
551 - print(" "+turquoise("WARNING:"))
552 - print(" If using our rsync server, emerge will clean out all files that do not")
553 - print(" exist on it, including ones that you may have created. The exceptions")
554 - print(" to this are the distfiles, local and packages directories.")
555 + print(desc_indent + green("NOTE:"))
556 + desc = "The emerge-webrsync program will download the entire " + \
557 + "portage tree as a tarball, which is much faster than emerge " + \
558 + "--sync for first time syncs."
559 + for line in wrap(desc, desc_width):
560 + print(desc_indent + line)
561 print()
562 print(" "+green("--unmerge")+" ("+green("-C")+" short option)")
563 print(" "+turquoise("WARNING: This action can remove important packages!"))
564 @@ -216,13 +229,6 @@
565 print(" ebuilds. For a dependency aware version of --unmerge, use")
566 print(" --depclean or --prune.")
567 print()
568 - print(" "+green("--update")+" ("+green("-u")+" short option)")
569 - print(" Updates packages to the best version available, which may not")
570 - print(" always be the highest version number due to masking for testing")
571 - print(" and development. Package atoms specified on the command")
572 - print(" line are greedy, meaning that unspecific atoms may match multiple")
573 - print(" installed versions of slotted packages.")
574 - print()
575 print(" "+green("--version")+" ("+green("-V")+" short option)")
576 print(" Displays the currently installed version of portage along with")
577 print(" other information useful for quick reference on a system. See")
578 @@ -591,6 +597,15 @@
579 for line in wrap(desc, desc_width):
580 print(desc_indent + line)
581 print()
582 + print(" "+green("--update")+" ("+green("-u")+" short option)")
583 + desc = "Updates packages to the best version available, which may " + \
584 + "not always be the highest version number due to masking " + \
585 + "for testing and development. Package atoms specified on " + \
586 + "the command line are greedy, meaning that unspecific " + \
587 + "atoms may match multiple versions of slotted packages."
588 + for line in wrap(desc, desc_width):
589 + print(desc_indent + line)
590 + print()
591 print(" " + green("--use-ebuild-visibility") + "[=%s]" % turquoise("n"))
592 desc = "Use unbuilt ebuild metadata for visibility " + \
593 "checks on built packages."
594 Index: pym/_emerge/Scheduler.py
595 ===================================================================
596 --- a/pym/_emerge/Scheduler.py (revision 15731)
597 +++ b/pym/_emerge/Scheduler.py (revision 15814)
598 @@ -1,6 +1,6 @@
599 # Copyright 1999-2009 Gentoo Foundation
600 # Distributed under the terms of the GNU General Public License v2
601 -# $Id: Scheduler.py 15708 2010-03-02 21:13:39Z zmedico $
602 +# $Id: Scheduler.py 15812 2010-03-09 21:27:32Z zmedico $
603
604 from __future__ import print_function
605
606 @@ -18,6 +18,7 @@
607 from portage import _unicode_decode
608 from portage import _unicode_encode
609 from portage.cache.mappings import slot_dict_class
610 +from portage.const import LIBC_PACKAGE_ATOM
611 from portage.elog.messages import eerror
612 from portage.output import colorize, create_color_func, darkgreen, red
613 bad = create_color_func("BAD")
614 @@ -351,6 +352,11 @@
615 self._find_system_deps()
616 self._prune_digraph()
617 self._prevent_builddir_collisions()
618 + self._implicit_libc_deps()
619 + if '--debug' in self.myopts:
620 + writemsg("\nscheduler digraph:\n\n", noiselevel=-1)
621 + self._digraph.debug_print()
622 + writemsg("\n", noiselevel=-1)
623
624 def _find_system_deps(self):
625 """
626 @@ -412,6 +418,69 @@
627 priority=DepPriority(buildtime=True))
628 cpv_map[pkg.cpv].append(pkg)
629
630 + def _implicit_libc_deps(self):
631 + """
632 + Create implicit dependencies on libc, in order to ensure that libc
633 + is installed as early as possible (see bug #303567). If the merge
634 + list contains both a new-style virtual and an old-style PROVIDE
635 + virtual, the new-style virtual is used.
636 + """
637 + implicit_libc_roots = set([self._running_root.root])
638 + libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
639 + norm_libc_pkgs = {}
640 + virt_libc_pkgs = {}
641 + for pkg in self._mergelist:
642 + if not isinstance(pkg, Package):
643 + # a satisfied blocker
644 + continue
645 + if pkg.installed:
646 + continue
647 + if pkg.root in implicit_libc_roots and \
648 + pkg.operation == 'merge':
649 + if libc_set.findAtomForPackage(pkg):
650 + if pkg.category == 'virtual':
651 + d = virt_libc_pkgs
652 + else:
653 + d = norm_libc_pkgs
654 + if pkg.root in d:
655 + raise AssertionError(
656 + "found 2 libc matches: %s and %s" % \
657 + (d[pkg.root], pkg))
658 + d[pkg.root] = pkg
659 +
660 + # Prefer new-style virtuals over old-style PROVIDE virtuals.
661 + libc_pkg_map = norm_libc_pkgs.copy()
662 + libc_pkg_map.update(virt_libc_pkgs)
663 +
664 + # Only add a dep when the version changes.
665 + for libc_pkg in list(libc_pkg_map.values()):
666 + if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
667 + libc_pkg.cpv):
668 + del libc_pkg_map[pkg.root]
669 +
670 + if not libc_pkg_map:
671 + return
672 +
673 + libc_pkgs = set(libc_pkg_map.values())
674 + earlier_libc_pkgs = set()
675 +
676 + for pkg in self._mergelist:
677 + if not isinstance(pkg, Package):
678 + # a satisfied blocker
679 + continue
680 + if pkg.installed:
681 + continue
682 + if pkg.root in implicit_libc_roots and \
683 + pkg.operation == 'merge':
684 + if pkg in libc_pkgs:
685 + earlier_libc_pkgs.add(pkg)
686 + else:
687 + my_libc = libc_pkg_map.get(pkg.root)
688 + if my_libc is not None and \
689 + my_libc in earlier_libc_pkgs:
690 + self._digraph.add(my_libc, pkg,
691 + priority=DepPriority(buildtime=True))
692 +
693 class _pkg_failure(portage.exception.PortageException):
694 """
695 An instance of this class is raised by unmerge() when
696 Index: pym/_emerge/sync/__init__.py
697 ===================================================================
698 --- a/pym/_emerge/sync/__init__.py (revision 15731)
699 +++ b/pym/_emerge/sync/__init__.py (revision 15814)
700 @@ -0,0 +1,3 @@
701 +# Copyright 2010 Gentoo Foundation
702 +# Distributed under the terms of the GNU General Public License v2
703 +# $Id: __init__.py 15772 2010-03-08 09:40:46Z zmedico $
704 Index: pym/_emerge/sync/old_tree_timestamp.py
705 ===================================================================
706 --- a/pym/_emerge/sync/old_tree_timestamp.py (revision 15731)
707 +++ b/pym/_emerge/sync/old_tree_timestamp.py (revision 15814)
708 @@ -0,0 +1,99 @@
709 +# Copyright 2010 Gentoo Foundation
710 +# Distributed under the terms of the GNU General Public License v2
711 +# $Id: old_tree_timestamp.py 15807 2010-03-09 20:21:05Z zmedico $
712 +
713 +import locale
714 +import logging
715 +import time
716 +
717 +from portage import os
718 +from portage.exception import PortageException
719 +from portage.localization import _
720 +from portage.output import EOutput
721 +from portage.util import grabfile, writemsg_level
722 +
723 +def have_english_locale():
724 + lang, enc = locale.getdefaultlocale()
725 + if lang is not None:
726 + lang = lang.lower()
727 + lang = lang.split('_', 1)[0]
728 + return lang is None or lang in ('c', 'en')
729 +
730 +def whenago(seconds):
731 + sec = int(seconds)
732 + mins = 0
733 + days = 0
734 + hrs = 0
735 + years = 0
736 + out = []
737 +
738 + if sec > 60:
739 + mins = sec / 60
740 + sec = sec % 60
741 + if mins > 60:
742 + hrs = mins / 60
743 + mins = mins % 60
744 + if hrs > 24:
745 + days = hrs / 24
746 + hrs = hrs % 24
747 + if days > 365:
748 + years = days / 365
749 + days = days % 365
750 +
751 + if years:
752 + out.append(str(years)+"y ")
753 + if days:
754 + out.append(str(days)+"d ")
755 + if hrs:
756 + out.append(str(hrs)+"h ")
757 + if mins:
758 + out.append(str(mins)+"m ")
759 + if sec:
760 + out.append(str(sec)+"s ")
761 +
762 + return "".join(out).strip()
763 +
764 +def old_tree_timestamp_warn(portdir, settings):
765 + unixtime = time.time()
766 + default_warnsync = 30
767 +
768 + timestamp_file = os.path.join(portdir, "metadata/timestamp.x")
769 + try:
770 + lastsync = grabfile(timestamp_file)
771 + except PortageException:
772 + return False
773 +
774 + if not lastsync:
775 + return False
776 +
777 + lastsync = lastsync[0].split()
778 + if not lastsync:
779 + return False
780 +
781 + try:
782 + lastsync = int(lastsync[0])
783 + except ValueError:
784 + return False
785 +
786 + var_name = 'PORTAGE_SYNC_STALE'
787 + try:
788 + warnsync = float(settings.get(var_name, default_warnsync))
789 + except ValueError:
790 + writemsg_level("!!! %s contains non-numeric value: %s\n" % \
791 + (var_name, settings[var_name]),
792 + level=logging.ERROR, noiselevel=-1)
793 + return False
794 +
795 + if warnsync <= 0:
796 + return False
797 +
798 + if (unixtime - 86400 * warnsync) > lastsync:
799 + out = EOutput()
800 + if have_english_locale():
801 + out.ewarn("Last emerge --sync was %s ago." % \
802 + whenago(unixtime - lastsync))
803 + else:
804 + out.ewarn(_("Last emerge --sync was %s.") % \
805 + time.strftime('%c', time.localtime(lastsync)))
806 + return True
807 + return False
808 Index: pym/portage/dbapi/vartree.py
809 ===================================================================
810 --- a/pym/portage/dbapi/vartree.py (revision 15731)
811 +++ b/pym/portage/dbapi/vartree.py (revision 15814)
812 @@ -1,6 +1,6 @@
813 # Copyright 1998-2009 Gentoo Foundation
814 # Distributed under the terms of the GNU General Public License v2
815 -# $Id: vartree.py 15727 2010-03-03 01:27:27Z zmedico $
816 +# $Id: vartree.py 15782 2010-03-09 02:42:40Z zmedico $
817
818 __all__ = [
819 "vardbapi", "vartree", "dblink"] + \
820 @@ -3181,6 +3181,9 @@
821 if self.myroot == "/" and \
822 match_from_list(PORTAGE_PACKAGE_ATOM, [self.mycpv]) and \
823 not self.vartree.dbapi.cpv_exists(self.mycpv):
824 + # Load lazily referenced portage submodules into memory,
825 + # so imports won't fail during portage upgrade/downgrade.
826 + portage.proxy.lazyimport._preload_portage_submodules()
827 settings = self.settings
828 base_path_orig = os.path.dirname(settings["PORTAGE_BIN_PATH"])
829 from tempfile import mkdtemp
830 Index: pym/portage/mail.py
831 ===================================================================
832 --- a/pym/portage/mail.py (revision 15731)
833 +++ b/pym/portage/mail.py (revision 15814)
834 @@ -1,36 +1,43 @@
835 # portage.py -- core Portage functionality
836 # Copyright 1998-2004 Gentoo Foundation
837 # Distributed under the terms of the GNU General Public License v2
838 -# $Id: mail.py 14860 2009-11-21 04:04:37Z zmedico $
839 +# $Id: mail.py 15794 2010-03-09 08:11:46Z zmedico $
840 +
841 +# Since python ebuilds remove the 'email' module when USE=build
842 +# is enabled, use a local import so that
843 +# portage.proxy.lazyimport._preload_portage_submodules()
844 +# can load this module even though the 'email' module is missing.
845 +# The elog mail modules won't work, but at least an ImportError
846 +# won't cause portage to crash during stage builds. Since the
847 +# 'smtlib' module imports the 'email' module, that's imported
848 +# locally as well.
849
850 -from email.mime.text import MIMEText
851 -from email.mime.multipart import MIMEMultipart as MultipartMessage
852 -from email.mime.base import MIMEBase as BaseMessage
853 -from email.header import Header
854 -import smtplib
855 import socket
856 import sys
857 import time
858
859 from portage import os
860 from portage import _encodings
861 -from portage import _unicode_encode
862 +from portage import _unicode_decode, _unicode_encode
863 from portage.localization import _
864 import portage
865
866 if sys.hexversion >= 0x3000000:
867 basestring = str
868
869 -if sys.hexversion >= 0x3000000:
870 - def TextMessage(_text):
871 - mimetext = MIMEText(_text)
872 +def TextMessage(_text):
873 + from email.mime.text import MIMEText
874 + mimetext = MIMEText(_text)
875 + if sys.hexversion >= 0x3000000:
876 mimetext.set_charset("UTF-8")
877 - return mimetext
878 -else:
879 - TextMessage = MIMEText
880 + return mimetext
881
882 def create_message(sender, recipient, subject, body, attachments=None):
883
884 + from email.header import Header
885 + from email.mime.base import MIMEBase as BaseMessage
886 + from email.mime.multipart import MIMEMultipart as MultipartMessage
887 +
888 if sys.hexversion < 0x3000000:
889 sender = _unicode_encode(sender,
890 encoding=_encodings['content'], errors='strict')
891 @@ -69,6 +76,9 @@
892 return mymessage
893
894 def send_mail(mysettings, message):
895 +
896 + import smtplib
897 +
898 mymailhost = "localhost"
899 mymailport = 25
900 mymailuser = ""
901 @@ -135,7 +145,17 @@
902 myconn = smtplib.SMTP(mymailhost, mymailport)
903 if mymailuser != "" and mymailpasswd != "":
904 myconn.login(mymailuser, mymailpasswd)
905 - myconn.sendmail(myfrom, myrecipient, message.as_string())
906 +
907 + message_str = message.as_string()
908 + if sys.hexversion >= 0x3000000:
909 + # Force ascii encoding in order to avoid UnicodeEncodeError
910 + # from smtplib.sendmail with python3 (bug #291331).
911 + message_str = _unicode_encode(message_str,
912 + encoding='ascii', errors='backslashreplace')
913 + message_str = _unicode_decode(message_str,
914 + encoding='ascii', errors='replace')
915 +
916 + myconn.sendmail(myfrom, myrecipient, message_str)
917 myconn.quit()
918 except smtplib.SMTPException as e:
919 raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))
920 Index: pym/portage/output.py
921 ===================================================================
922 --- a/pym/portage/output.py (revision 15731)
923 +++ b/pym/portage/output.py (revision 15814)
924 @@ -1,6 +1,6 @@
925 # Copyright 1998-2009 Gentoo Foundation
926 # Distributed under the terms of the GNU General Public License v2
927 -# $Id: output.py 15245 2010-01-29 18:47:30Z zmedico $
928 +# $Id: output.py 15746 2010-03-04 11:22:15Z zmedico $
929
930 __docformat__ = "epytext"
931
932 @@ -139,6 +139,9 @@
933 _styles["PKG_MERGE"] = ( "darkgreen", )
934 _styles["PKG_MERGE_SYSTEM"] = ( "darkgreen", )
935 _styles["PKG_MERGE_WORLD"] = ( "green", )
936 +_styles["PKG_BINARY_MERGE"] = ( "darkgreen", )
937 +_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "darkgreen", )
938 +_styles["PKG_BINARY_MERGE_WORLD"] = ( "green", )
939 _styles["PKG_UNINSTALL"] = ( "red", )
940 _styles["PKG_NOMERGE"] = ( "darkblue", )
941 _styles["PKG_NOMERGE_SYSTEM"] = ( "darkblue", )
942 Index: pym/portage/package/ebuild/config.py
943 ===================================================================
944 --- a/pym/portage/package/ebuild/config.py (revision 15731)
945 +++ b/pym/portage/package/ebuild/config.py (revision 15814)
946 @@ -1,6 +1,6 @@
947 # Copyright 2010 Gentoo Foundation
948 # Distributed under the terms of the GNU General Public License v2
949 -# $Id: config.py 15705 2010-03-02 21:11:02Z zmedico $
950 +# $Id: config.py 15768 2010-03-08 09:05:13Z zmedico $
951
952 __all__ = [
953 'autouse', 'best_from_dict', 'check_config_instance', 'config',
954 @@ -274,7 +274,8 @@
955 "PORTAGE_REPO_DUPLICATE_WARN",
956 "PORTAGE_RO_DISTDIRS",
957 "PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
958 - "PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR",
959 + "PORTAGE_RSYNC_RETRIES", "PORTAGE_SYNC_STALE",
960 + "PORTAGE_USE", "PORT_LOGDIR",
961 "QUICKPKG_DEFAULT_OPTS",
962 "RESUMECOMMAND", "RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTP",
963 "RESUMECOMMAND_SFTP", "SYNC", "USE_EXPAND_HIDDEN", "USE_ORDER",
964 Index: pym/portage/package/ebuild/doebuild.py
965 ===================================================================
966 --- a/pym/portage/package/ebuild/doebuild.py (revision 15731)
967 +++ b/pym/portage/package/ebuild/doebuild.py (revision 15814)
968 @@ -1,6 +1,6 @@
969 # Copyright 2010 Gentoo Foundation
970 # Distributed under the terms of the GNU General Public License v2
971 -# $Id: doebuild.py 15713 2010-03-02 21:14:43Z zmedico $
972 +# $Id: doebuild.py 15760 2010-03-08 08:46:53Z zmedico $
973
974 __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
975
976 @@ -25,6 +25,7 @@
977 'portage.package.ebuild.config:check_config_instance',
978 'portage.package.ebuild.digestcheck:digestcheck',
979 'portage.package.ebuild.digestgen:digestgen',
980 + 'portage.package.ebuild.fetch:fetch',
981 'portage.util.ExtractKernelVersion:ExtractKernelVersion'
982 )
983
984 @@ -47,7 +48,6 @@
985 from portage.localization import _
986 from portage.manifest import Manifest
987 from portage.output import style_to_ansi_code
988 -from portage.package.ebuild.fetch import fetch
989 from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
990 from portage.util import apply_recursive_permissions, \
991 apply_secpass_permissions, noiselimit, normalize_path, \
992 @@ -810,7 +810,8 @@
993 mydo not in ("digest", "manifest") and "noauto" not in features)
994 alist = mysettings.configdict["pkg"].get("A")
995 aalist = mysettings.configdict["pkg"].get("AA")
996 - if alist is None or aalist is None:
997 + if alist is None or aalist is None or \
998 + (not emerge_skip_distfiles and need_distfiles):
999 # Make sure we get the correct tree in case there are overlays.
1000 mytree = os.path.realpath(
1001 os.path.dirname(os.path.dirname(mysettings["O"])))
1002 @@ -827,25 +828,26 @@
1003 return 1
1004 mysettings.configdict["pkg"]["A"] = " ".join(alist)
1005 mysettings.configdict["pkg"]["AA"] = " ".join(aalist)
1006 +
1007 + if not emerge_skip_distfiles and need_distfiles:
1008 + if "mirror" in features or fetchall:
1009 + fetchme = aalist
1010 + else:
1011 + fetchme = alist
1012 + if not fetch(fetchme, mysettings, listonly=listonly,
1013 + fetchonly=fetchonly):
1014 + return 1
1015 +
1016 else:
1017 alist = set(alist.split())
1018 aalist = set(aalist.split())
1019 - if ("mirror" in features) or fetchall:
1020 - fetchme = aalist
1021 - checkme = aalist
1022 - else:
1023 - fetchme = alist
1024 - checkme = alist
1025
1026 if mydo == "fetch":
1027 # Files are already checked inside fetch(),
1028 # so do not check them again.
1029 checkme = []
1030 -
1031 - if not emerge_skip_distfiles and \
1032 - need_distfiles and not fetch(
1033 - fetchme, mysettings, listonly=listonly, fetchonly=fetchonly):
1034 - return 1
1035 + else:
1036 + checkme = alist
1037
1038 if mydo == "fetch" and listonly:
1039 return 0
1040 Index: pym/portage/package/ebuild/fetch.py
1041 ===================================================================
1042 --- a/pym/portage/package/ebuild/fetch.py (revision 15731)
1043 +++ b/pym/portage/package/ebuild/fetch.py (revision 15814)
1044 @@ -1,6 +1,6 @@
1045 # Copyright 2010 Gentoo Foundation
1046 # Distributed under the terms of the GNU General Public License v2
1047 -# $Id: fetch.py 15718 2010-03-02 21:37:48Z zmedico $
1048 +# $Id: fetch.py 15748 2010-03-04 11:23:00Z zmedico $
1049
1050 from __future__ import print_function
1051
1052 @@ -20,18 +20,26 @@
1053 import portage
1054 portage.proxy.lazyimport.lazyimport(globals(),
1055 'portage.package.ebuild.config:check_config_instance,config',
1056 + 'portage.package.ebuild.doebuild:doebuild_environment,' + \
1057 + 'spawn@doebuild_spawn',
1058 + 'portage.package.ebuild.prepare_build_dirs:prepare_build_dirs',
1059 )
1060
1061 -from portage import doebuild_environment, OrderedDict, os, prepare_build_dirs, selinux, _encodings, _shell_quote, _unicode_encode
1062 +from portage import OrderedDict, os, selinux, _encodings, \
1063 + _shell_quote, _unicode_encode
1064 from portage.checksum import perform_md5, verify_all
1065 -from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
1066 +from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, \
1067 + EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
1068 from portage.data import portage_gid, portage_uid, secpass, userpriv_groups
1069 -from portage.exception import FileNotFound, OperationNotPermitted, PermissionDenied, PortageException, TryAgain
1070 +from portage.exception import FileNotFound, OperationNotPermitted, \
1071 + PermissionDenied, PortageException, TryAgain
1072 from portage.localization import _
1073 from portage.locks import lockfile, unlockfile
1074 from portage.manifest import Manifest
1075 from portage.output import colorize, EOutput
1076 -from portage.util import apply_recursive_permissions, apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, varexpand, writemsg, writemsg_level, writemsg_stdout
1077 +from portage.util import apply_recursive_permissions, \
1078 + apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
1079 + varexpand, writemsg, writemsg_level, writemsg_stdout
1080 from portage.process import spawn
1081
1082 _userpriv_spawn_kwargs = (
1083 @@ -1096,7 +1104,7 @@
1084 ebuild_phase = mysettings.get("EBUILD_PHASE")
1085 try:
1086 mysettings["EBUILD_PHASE"] = "nofetch"
1087 - spawn(_shell_quote(EBUILD_SH_BINARY) + \
1088 + doebuild_spawn(_shell_quote(EBUILD_SH_BINARY) + \
1089 " nofetch", mysettings, fd_pipes=fd_pipes)
1090 finally:
1091 if ebuild_phase is None:
1092 Index: pym/portage/package/ebuild/getmaskingstatus.py
1093 ===================================================================
1094 --- a/pym/portage/package/ebuild/getmaskingstatus.py (revision 15731)
1095 +++ b/pym/portage/package/ebuild/getmaskingstatus.py (revision 15814)
1096 @@ -1,9 +1,11 @@
1097 # Copyright 2010 Gentoo Foundation
1098 # Distributed under the terms of the GNU General Public License v2
1099 -# $Id: getmaskingstatus.py 15672 2010-03-02 21:01:19Z zmedico $
1100 +# $Id: getmaskingstatus.py 15749 2010-03-04 11:23:09Z zmedico $
1101
1102 __all__ = ['getmaskingstatus']
1103
1104 +import sys
1105 +
1106 import portage
1107 from portage import eapi_is_supported, _eapi_is_deprecated
1108 from portage.dep import match_from_list
1109 @@ -11,6 +13,9 @@
1110 from portage.package.ebuild.config import config
1111 from portage.versions import catpkgsplit, cpv_getkey
1112
1113 +if sys.hexversion >= 0x3000000:
1114 + basestring = str
1115 +
1116 def getmaskingstatus(mycpv, settings=None, portdb=None):
1117 if settings is None:
1118 settings = config(clone=portage.settings)
1119 Index: pym/portage/proxy/lazyimport.py
1120 ===================================================================
1121 --- a/pym/portage/proxy/lazyimport.py (revision 15731)
1122 +++ b/pym/portage/proxy/lazyimport.py (revision 15814)
1123 @@ -1,6 +1,6 @@
1124 # Copyright 2009 Gentoo Foundation
1125 # Distributed under the terms of the GNU General Public License v2
1126 -# $Id: lazyimport.py 14327 2009-09-21 16:07:07Z arfrever $
1127 +# $Id: lazyimport.py 15782 2010-03-09 02:42:40Z zmedico $
1128
1129 __all__ = ['lazyimport']
1130
1131 @@ -20,6 +20,24 @@
1132 _module_proxies = {}
1133 _module_proxies_lock = threading.RLock()
1134
1135 +def _preload_portage_submodules():
1136 + """
1137 + Load lazily referenced portage submodules into memory,
1138 + so imports won't fail during portage upgrade/downgrade.
1139 + Note that this recursively loads only the modules that
1140 + are lazily referenced by currently imported modules,
1141 + so some portage submodules may still remain unimported
1142 + after this function is called.
1143 + """
1144 + while True:
1145 + remaining = False
1146 + for name in list(_module_proxies):
1147 + if name.startswith('portage.'):
1148 + remaining = True
1149 + _unregister_module_proxy(name)
1150 + if not remaining:
1151 + break
1152 +
1153 def _register_module_proxy(name, proxy):
1154 _module_proxies_lock.acquire()
1155 try: