emerge --info: don't error for existing packages
authorZac Medico <zmedico@gentoo.org>
Sat, 8 Dec 2012 01:49:27 +0000 (17:49 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 8 Dec 2012 01:49:27 +0000 (17:49 -0800)
This will fix bug #446358.

pym/_emerge/actions.py

index d0c3e23db21ced034905a22081f56a4440b9eb2a..fcaa2c1cc9ff9d488aaf80a1ca5f259694bbecb1 100644 (file)
@@ -1366,14 +1366,14 @@ def action_info(settings, trees, myopts, myfiles):
        portdb = trees[eroot]['porttree'].dbapi
        bindb = trees[eroot]["bintree"].dbapi
        for x in myfiles:
-               match_found = False
+               any_match = False
                cp_exists = False
                installed_match = vardb.match(x)
                for installed in installed_match:
                        mypkgs.append((installed, "installed"))
-                       match_found = True
+                       any_match = True
 
-               if match_found:
+               if any_match:
                        continue
 
                for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")):
@@ -1386,6 +1386,7 @@ def action_info(settings, trees, myopts, myfiles):
                        matches = db.match(x)
                        matches.reverse()
                        for match in matches:
+                               any_match = True
                                if pkg_type == "binary":
                                        if db.bintree.isremote(match):
                                                continue
@@ -1394,10 +1395,9 @@ def action_info(settings, trees, myopts, myfiles):
                                if metadata["EAPI"] not in ("0", "1", "2", "3") and \
                                        "info" in metadata["DEFINED_PHASES"].split():
                                        mypkgs.append((match, pkg_type))
-                                       match_found = True
                                        break
 
-               if not match_found:
+               if not any_match:
                        xinfo = '"%s"' % x.unevaluated_atom
                        # Discard null/ from failed cpv_expand category expansion.
                        xinfo = xinfo.replace("null/", "")