diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-04-11 02:12:08 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-04-11 02:12:08 +0000 |
| commit | 5018062a876be7664728044b9e81ad1b02dae76e (patch) | |
| tree | d6b5327996ea87e3d28f39baae2cd9be4c557554 /trunk/src | |
| parent | 1bafc7c41584c7e5fe639acdab5809b38d210a21 (diff) | |
| download | gentoolkit-5018062a876be7664728044b9e81ad1b02dae76e.tar.gz | |
Change equery uses command to display the best matching
uninstalled package version if an uninstalled package is specified.
Changed the meaning of -a to mean display all versions. (Bug #152325)
svn path=/; revision=386
Diffstat (limited to 'trunk/src')
| -rwxr-xr-x | trunk/src/equery/equery | 19 | ||||
| -rw-r--r-- | trunk/src/equery/equery.1 | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 72bef59..50f2cae 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -447,7 +447,7 @@ class CmdDisplayUSEs(Command): """Advanced report of a package's USE flags""" def __init__(self): self.default_opts = { - "installedOnly" : True + "allPackages" : False } def parseArgs(self, args): @@ -467,7 +467,7 @@ class CmdDisplayUSEs(Command): need_help = 1 break elif x in ["-a", "--all"]: - opts["installedOnly"] = False + opts["allPackages"] = True else: query = x @@ -484,8 +484,13 @@ class CmdDisplayUSEs(Command): if not Config["piping"] and Config["verbosityLevel"] >= 3: print_info(3, "[ Searching for packages matching " + pp.pkgquery(query) + "... ]") - if opts["installedOnly"]: + if not opts["allPackages"]: matches = gentoolkit.find_installed_packages(query, True) + if not matches: + matches = gentoolkit.find_packages(query, False) + if matches: + matches = gentoolkit.sort_package_list(matches) + matches = matches[-1:] else: matches = gentoolkit.find_packages(query, True) @@ -533,12 +538,10 @@ class CmdDisplayUSEs(Command): print_info(3, "[ : Right column (I) - USE flags packages was installed with ]") # Iterate through matches, printing a report for each package + matches = gentoolkit.sort_package_list(matches) matches_found = 0 for p in matches: - if not p.is_installed() and opts["installedOnly"]: - continue - matches_found += 1 bestver = p.get_cpv() @@ -615,8 +618,6 @@ class CmdDisplayUSEs(Command): if Config["verbosityLevel"] >= 2: if matches_found == 0: s = "" - if opts["installedOnly"]: - s = "installed " die(3, "No " + s + "packages found for " + pp.pkgquery(query)) @@ -629,7 +630,7 @@ class CmdDisplayUSEs(Command): " " + pp.command("uses") + pp.localoption(" <local-opts> ") + pp.pkgquery("pkgspec") + \ "\n" + \ pp.localoption("<local-opts>") + " is: \n" + \ - " " + pp.localoption("-a, --all") + " - include non-installed packages\n" + " " + pp.localoption("-a, --all") + " - include all package versions\n" class CmdDisplayDepGraph(Command): diff --git a/trunk/src/equery/equery.1 b/trunk/src/equery/equery.1 index 576519d..fa8d657 100644 --- a/trunk/src/equery/equery.1 +++ b/trunk/src/equery/equery.1 @@ -246,7 +246,7 @@ display USE flags for pkgspec. The only possible value for <local\-opts>, if specified, is: .br .B \-a, \-\-all -include non\-installed packages +include all package versions .PP .B which pkgspec print full path to ebuild for package pkgspec |
