Commits

Michał Górny committed 5b3947a

Use hardcoded paths rather than portage consts.

Comments (0)

Files changed (2)

lib/flaggie/cache.py

 
 import os, os.path
 
-from portage.const import USER_CONFIG_PATH
 from portage.dep import use_reduce
 from portage.util import grabdict, grabfile
 from portage.versions import best
 	class EnvCache(object):
 		def __init__(self, dbapi):
 			out = set()
-			path = os.path.join(dbapi.settings['PORTAGE_CONFIGROOT'], USER_CONFIG_PATH, 'env')
+			path = os.path.join(os.environ.get('PORTAGE_CONFIGROOT', '/'),
+					'etc', 'portage', 'env')
 			for parent, dirs, files in os.walk(path):
 				out.update([os.path.relpath(os.path.join(parent, x), path) for x in files])
 			self.cache = frozenset(out)

lib/flaggie/cli.py

 import codecs, locale, os, os.path, sys
 
 from portage import create_trees
-from portage.const import MAKE_CONF_FILE, USER_CONFIG_PATH
 from portage.dbapi.dep_expand import dep_expand
 from portage.dep import Atom
 from portage.exception import AmbiguousPackageName, InvalidAtom
 		main([argv[0], '--help'])
 		return 0
 
-	confroot = porttree.settings['PORTAGE_CONFIGROOT']
-	usercpath = os.path.join(confroot, USER_CONFIG_PATH)
+	confroot = os.environ.get('PORTAGE_CONFIGROOT', '/')
+	usercpath = os.path.join(confroot, 'etc', 'portage')
 	mkconf = MakeConf(
-		(os.path.join(confroot, MAKE_CONF_FILE),
+		(os.path.join(confroot, 'etc', 'make.conf'),
 			os.path.join(usercpath, 'make.conf')),
 		porttree, cache)
 	pfiles = PackageFiles(usercpath, porttree, mkconf)