diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-04-23 23:19:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-04-23 23:19:48 +0000 |
commit | 1600d772a443b8550279889ea16c25f50749e702 (patch) | |
tree | 7b64f1183996bd651cc4a37fa427006eb21a635c | |
parent | c2bc3f92b572fbb7c64579093a266c88948361c0 (diff) | |
download | portage-1600d772a443b8550279889ea16c25f50749e702.tar.gz portage-1600d772a443b8550279889ea16c25f50749e702.tar.bz2 portage-1600d772a443b8550279889ea16c25f50749e702.zip |
Move deprecated profile check out of global scope.
svn path=/main/trunk/; revision=3204
-rwxr-xr-x | bin/emerge | 2 | ||||
-rw-r--r-- | pym/portage.py | 30 |
2 files changed, 19 insertions, 13 deletions
diff --git a/bin/emerge b/bin/emerge index 13b99bdcd..3c1f0b156 100755 --- a/bin/emerge +++ b/bin/emerge @@ -153,6 +153,8 @@ def sorted_versions(verlist): ret.insert(x, ver) return ret +portage.deprecated_profile_check() + if portage.settings.has_key("PORTAGE_NICENESS"): try: os.nice(int(portage.settings["PORTAGE_NICENESS"])) diff --git a/pym/portage.py b/pym/portage.py index acd34f1f4..0b5a1c29e 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6445,19 +6445,23 @@ os.umask(022) profiledir=None if os.path.isdir(PROFILE_PATH): profiledir = PROFILE_PATH - if "PORTAGE_CALLER" in os.environ and os.environ["PORTAGE_CALLER"] == "emerge" and os.access(DEPRECATED_PROFILE_FILE, os.R_OK): - deprecatedfile = open(DEPRECATED_PROFILE_FILE, "r") - dcontent = deprecatedfile.readlines() - deprecatedfile.close() - newprofile = dcontent[0] - writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n")) - writemsg(red("!!! Please upgrade to the following profile if possible:\n")) - writemsg(8*" "+green(newprofile)+"\n") - if len(dcontent) > 1: - writemsg("To upgrade do the following steps:\n") - for myline in dcontent[1:]: - writemsg(myline) - writemsg("\n\n") + +def deprecated_profile_check(): + if not os.access(DEPRECATED_PROFILE_FILE, os.R_OK): + return False + deprecatedfile = open(DEPRECATED_PROFILE_FILE, "r") + dcontent = deprecatedfile.readlines() + deprecatedfile.close() + newprofile = dcontent[0] + writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n")) + writemsg(red("!!! Please upgrade to the following profile if possible:\n")) + writemsg(8*" "+green(newprofile)+"\n") + if len(dcontent) > 1: + writemsg("To upgrade do the following steps:\n") + for myline in dcontent[1:]: + writemsg(myline) + writemsg("\n\n") + return True if os.path.exists(USER_VIRTUALS_FILE): writemsg(red("\n!!! /etc/portage/virtuals is deprecated in favor of\n")) |