From 5018062a876be7664728044b9e81ad1b02dae76e Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Wed, 11 Apr 2007 02:12:08 +0000 Subject: [PATCH] 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 --- trunk/ChangeLog | 5 +++++ trunk/src/equery/equery | 19 ++++++++++--------- trunk/src/equery/equery.1 | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 7c6204a..13a5da8 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,8 @@ +2007-04-10: Paul Varner + * equery: Change equery uses to 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) + 2007-04-01: Alec Warner * eread: Fix path and fully qualified paths (Bug #172969) 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(" ") + pp.pkgquery("pkgspec") + \ "\n" + \ pp.localoption("") + " 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 , 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 -- 2.26.2