Fix updated Package class to work correctly with prefix portage
authorPaul Varner <fuzzyray@gentoo.org>
Sat, 16 Jul 2011 04:02:07 +0000 (23:02 -0500)
committerPaul Varner <fuzzyray@gentoo.org>
Sat, 16 Jul 2011 04:02:07 +0000 (23:02 -0500)
pym/gentoolkit/package.py

index 45e59bdcd4850072825a31e19f2bd107d538ee30..85dbfd0777dedc0506ea5a44e3f51af539ea4d10 100644 (file)
@@ -55,15 +55,22 @@ from gentoolkit.cpv import CPV
 from gentoolkit.dbapi import PORTDB, VARDB
 from gentoolkit.keyword import determine_keyword
 from gentoolkit.flag import get_flags
+from gentoolkit.eprefix import EPREFIX
 
 # =======
 # Settings
 # =======
 
-default_settings = portage.config(local_config=True)
-default_settings.lock()
-nolocal_settings = portage.config(local_config=False)
-nolocal_settings.lock()
+if EPREFIX:
+       default_settings = portage.config(local_config=True, _eprefix=EPREFIX)
+       default_settings.lock()
+       nolocal_settings = portage.config(local_config=False, _eprefix=EPREFIX)
+       nolocal_settings.lock()
+else:
+       default_settings = portage.config(local_config=True)
+       default_settings.lock()
+       nolocal_settings = portage.config(local_config=False)
+       nolocal_settings.lock()
 
 # =======
 # Classes