1. Michał Górny
  2. flaggie

Commits

Michał Górny  committed 13503a7

Match USE_EXPAND vars in the global FlagCache.

  • Participants
  • Parent commits 6c4c097
  • Branches master

Comments (0)

Files changed (1)

File lib/flaggie/cache.py

View file
 from portage.util import grabdict, grabfile
 from portage.versions import best
 
-def grab_use_desc(path):
+def grab_use_desc(path, prefix = ''):
 	flags = {}
 	try:
 		f = open(path, 'r')
 		for l in f:
 			ll = l.split(' - ', 1)
 			if len(ll) > 1:
-				flags[ll[0]] = ll[1].strip()
+				flags[prefix + ll[0]] = ll[1].strip()
 		f.close()
 
 	return flags
 				flags = set()
 				for r in self.dbapi.porttrees:
 					flags.update(grab_use_desc(os.path.join(r, 'profiles', 'use.desc')))
+					for k in self.use_expand_vars:
+						flags.update(grab_use_desc(
+							os.path.join(r, 'profiles', 'desc', '%s.desc' % k.lower()),
+							prefix = '%s_' % k.lower()))
 				self.cache[None] = frozenset(flags)
 
 			return self.cache[None]