matches = gentoolkit.find_packages(query)
+ if not matches:
+ print yellow("No matching packages found for \"%s\"" % query)
+ return
+
useflags = gentoolkit.settings["USE"].split()
usedesc = {}
uselocaldesc = {}
print "[ Legend : (U) Col 1 - Current USE flags ]"
print "[ : (I) Col 2 - Installed With USE flags ]"
+ if filter(gentoolkit.Package.is_installed, matches):
+ only_installed = True
+ else:
+ only_installed = False
+
# Iterate through matches, printing a report for each package
for p in matches:
- if not p.is_installed():
+ if not p.is_installed() and only_installed:
continue
bestver = p.get_cpv()
usevar = []
inuse = []
- used = p.get_use_vars().split()
+ if p.is_installed():
+ used = p.get_use_vars().split()
+ else:
+ # cosmetic issue here as noninstalled packages don't have "used" flags
+ used = useflags
# store (inuse, inused, flag, desc)
output = []