Merged from trunk 5885:5891
authorFabian Groffen <grobian@gentoo.org>
Mon, 5 Feb 2007 19:05:36 +0000 (19:05 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 5 Feb 2007 19:05:36 +0000 (19:05 -0000)
Fix "UnboundLocalError: local variable 'portage' referenced before
assignment" caused by a local import hiding a global import
(undid changeset 5884:5885 for this)

For bug #165349, use the portage_versions regex (via pkgsplit) instead
of the incompatible ones that repoman currently uses.

Document --config-root for bug #165334.

For bug #165382, don't raise a ValueError in cpv_expand() if there are
only two matches and one of them is a virtual.  Prefer the non-virtual
instead.

Ensure that the code for bug #165342 only affects name collisions with
virtuals.

svn path=/main/branches/prefix/; revision=5892

bin/emerge
man/emerge.1
pym/portage/__init__.py

index cb9b89b20d3a8a49b15b0abeb2ce820442c4abe6..24a624a3427dbf881d5da0204ca224161174195b 100755 (executable)
@@ -45,7 +45,6 @@ import portage.dep
 import portage.util
 import portage.locks
 import portage.exception
-import portage.cache.util
 from portage.const import EPREFIX
 from portage.data import secpass
 from portage.util import normalize_path as normpath
@@ -4129,7 +4128,9 @@ def action_metadata(settings, portdb, myopts):
        cm = settings.load_best_module("portdbapi.metadbmodule")(
                myportdir, "metadata/cache", portage.auxdbkeys[:])
 
-       class percentage_noise_maker(portage.cache.util.quiet_mirroring):
+       from portage.cache import util
+
+       class percentage_noise_maker(util.quiet_mirroring):
                def __init__(self, dbapi):
                        self.dbapi = dbapi
                        self.cp_all = dbapi.cp_all()
index 671ca4d24cffb44f0b0447f92e00259e22f4e88b..71dc1e49c5d22c94608143e865c1f00f0ddea912 100644 (file)
@@ -232,6 +232,9 @@ is not a tty (by default, color is disabled unless stdout is a tty).
 Used alongside \fB\-\-pretend\fR to cause the package name, new version, 
 and old version to be displayed in an aligned format for easy cut\-n\-paste.
 .TP
+.BR \-\-config\-root=DIR
+Set the \fBPORTAGE_CONFIGROOT\fR environment variable.
+.TP
 .BR "\-\-debug " (\fB\-d\fR)
 Tells emerge to run the emerge command in \fB\-\-debug\fR mode.  In this
 mode the bash build environment will run with the \-x option, causing 
@@ -397,14 +400,16 @@ command line.
 .TP
 \fBROOT\fR = \fI[path]\fR
 Use \fBROOT\fR to specify the target root filesystem to be used for
-merging packages or ebuilds.
+merging packages or ebuilds.  This variable can be set in \fBmake.conf\fR(5)
+when \fBPORTAGE_CONFIGROOT\fR has a value other than /.
 .br
 Defaults to /.
 .TP
 \fBPORTAGE_CONFIGROOT\fR = \fI[path]\fR
 Use \fBPORTAGE_CONFIGROOT\fR to specify the location for various portage 
 configuration files
-(see \fBFILES\fR for a detailed list of configuration files).
+(see \fBFILES\fR for a detailed list of configuration files).  This variable
+can be set via the \fB\-\-config\-root\fR option.
 .br
 Defaults to /.
 .SH "OUTPUT"
index a91fccff0029d7280f0f6968f6d9e2eede7f1db3..f8e65cb8498beb9443c5ca8baf8a1036b265de88 100644 (file)
@@ -4454,8 +4454,20 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
                        for x in settings.categories:
                                if mydb.cp_list(x+"/"+myp,use_cache=use_cache):
                                        matches.append(x+"/"+myp)
-               if (len(matches)>1):
-                       raise ValueError, matches
+               if len(matches) > 1:
+                       virtual_name_collision = False
+                       if len(matches) == 2:
+                               for x in matches:
+                                       if not x.startswith("virtual/"):
+                                               # Assume that the non-virtual is desired.  This helps
+                                               # avoid the ValueError for invalid deps that come from
+                                               # installed packages (during reverse blocker detection,
+                                               # for example).
+                                               mykey = x
+                                       else:
+                                               virtual_name_collision = True
+                       if not virtual_name_collision:
+                               raise ValueError, matches
                elif matches:
                        mykey=matches[0]