From 1fb987e7e76b1e13c40e767cda2060525917fd52 Mon Sep 17 00:00:00 2001 From: betelgeuse Date: Thu, 27 Nov 2008 13:52:01 +0000 Subject: [PATCH] Add support for showing USE_EXPAND variables. Patch from Michael A. Smith . Fixes bug #238005. svn path=/; revision=524 --- trunk/src/equery/equery | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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: -- 2.26.2