Fix deprecated_profile_check() to account for PORTAGE_CONFIGROOT. Thanks to
authorZac Medico <zmedico@gentoo.org>
Mon, 8 Dec 2008 21:20:23 +0000 (21:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 8 Dec 2008 21:20:23 +0000 (21:20 -0000)
Jeremy Olexa <darkside@g.o> for the initial patch.

svn path=/main/trunk/; revision=12181

pym/_emerge/__init__.py
pym/portage/__init__.py

index 996590da0a25a6713dcae0505575d6e0e62bf86a..1f782b4517c4bdeda5cd82fde9f340a559fa72e4 100644 (file)
@@ -14208,7 +14208,7 @@ def emerge_main():
                spinner.update = spinner.update_scroll
 
        if "--quiet" not in myopts:
-               portage.deprecated_profile_check()
+               portage.deprecated_profile_check(settings=settings)
                repo_name_check(trees)
                config_protect_check(trees)
 
index aabed8283bc9e84686b12216e93a01a70345bdde..2a559f3af56a5ba9cdd545de73fc4cc2009d87ab 100644 (file)
@@ -7240,10 +7240,15 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None,
                                        raise
                                del e
 
-def deprecated_profile_check():
-       if not os.access(DEPRECATED_PROFILE_FILE, os.R_OK):
+def deprecated_profile_check(settings=None):
+       config_root = "/"
+       if settings is not None:
+               config_root = settings["PORTAGE_CONFIGROOT"]
+       deprecated_profile_file = os.path.join(config_root,
+               DEPRECATED_PROFILE_FILE.lstrip(os.sep))
+       if not os.access(deprecated_profile_file, os.R_OK):
                return False
-       deprecatedfile = open(DEPRECATED_PROFILE_FILE, "r")
+       deprecatedfile = open(deprecated_profile_file, "r")
        dcontent = deprecatedfile.readlines()
        deprecatedfile.close()
        writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n"),