From: betelgeuse Date: Thu, 27 Nov 2008 13:52:01 +0000 (-0000) Subject: Add support for showing USE_EXPAND variables. Patch from Michael A. Smith . Fixes bug #238005. svn path=/; revision=524 --- diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index b1bc730..a1239d9 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -17,6 +17,7 @@ import os import re import sys import time +from glob import glob # portage (output module) and gentoolkit need special path modifications sys.path.insert(0, "/usr/lib/gentoolkit/pym") @@ -534,6 +535,17 @@ class CmdDisplayUSEs(Command): # for all files in gentoolkit.settings["PORTDIR"]+"/desc/*.desc # variable name = _ # description = + for descfile in glob(gentoolkit.settings["PORTDIR"]+"/profiles/desc/*.desc"): + try: + fd = open(descfile) + for line in fd.readlines(): + if line[0] == "#": + continue + fields = [field.strip() for field in line.split(" - ", 1)] + if len(fields) == 2: + usedesc["%s_%s" % (descfile.split("/")[-1][0:-5], fields[0],)] = fields[1] + except IOError: + print_warn(5, "Could not load USE flag descriptions from " + descfile) # Load local USE flag descriptions try: