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")
# for all files in gentoolkit.settings["PORTDIR"]+"/desc/*.desc
# variable name = <filename>_<field1>
# description = <field 2>
+ 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: