Commits

Michał Górny  committed 26b353f

Actually obey PORTAGE_CONFIGROOT.

  • Participants
  • Parent commits 4b3f279

Comments (0)

Files changed (2)

File lib/flaggie/cli.py

 import os, os.path
 
 from portage import create_trees
+from portage.const import USER_CONFIG_PATH
 from portage.dbapi.dep_expand import dep_expand
 from portage.exception import AmbiguousPackageName, InvalidAtom
 
 		main([argv[0], '--help'])
 		return 0
 
-	pfiles = PackageFiles()
+	pfiles = PackageFiles(os.path.join( \
+		porttree.settings['PORTAGE_CONFIGROOT'], USER_CONFIG_PATH))
 	for actset in act:
 		try:
 			actset(pfiles)

File lib/flaggie/packagefile.py

 			f.modified = True
 
 class PackageFiles(object):
-	def __init__(self):
-		self.files = {
-			'use': PackageFileSet('/etc/portage/package.use'),
-			'kw': PackageFileSet('/etc/portage/package.keywords'),
-			'lic': PackageFileSet('/etc/portage/package.license')
-		}
+	def __init__(self, basedir):
+		fmap = (
+			('use', 'package.use'),
+			('kw', 'package.keywords'),
+			('lic', 'package.license')
+		)
+
+		self.files = {}
+		for k, fn in fmap:
+			self.files[k] = PackageFileSet(os.path.join(basedir, fn))
 
 	def __getitem__(self, k):
 		return self.files[k]