From: Zac Medico Date: Thu, 20 Sep 2012 03:37:55 +0000 (-0700) Subject: deprecated_profile_check: search more locations X-Git-Tag: v2.2.0_alpha130~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48a61cc19483628d30346488c252008a8c646d39;p=portage.git deprecated_profile_check: search more locations This fixes it to search both /etc/make.profile and /etc/portage/make.profile, and also makes it traverse parent profiles when the settings parameter is passed in. --- diff --git a/pym/portage/package/ebuild/deprecated_profile_check.py b/pym/portage/package/ebuild/deprecated_profile_check.py index 3fab4da6e..ddb8c70f5 100644 --- a/pym/portage/package/ebuild/deprecated_profile_check.py +++ b/pym/portage/package/ebuild/deprecated_profile_check.py @@ -13,12 +13,25 @@ from portage.util import writemsg def deprecated_profile_check(settings=None): config_root = "/" + deprecated_profile_file = None if settings is not None: config_root = settings["PORTAGE_CONFIGROOT"] - deprecated_profile_file = os.path.join(config_root, - DEPRECATED_PROFILE_FILE) - if not os.access(deprecated_profile_file, os.R_OK): - return False + for x in reversed(settings.profiles): + deprecated_profile_file = os.path.join(x, "deprecated") + if os.access(deprecated_profile_file, os.R_OK): + break + else: + deprecated_profile_file = None + + if deprecated_profile_file is None: + deprecated_profile_file = os.path.join(config_root, + DEPRECATED_PROFILE_FILE) + if not os.access(deprecated_profile_file, os.R_OK): + deprecated_profile_file = os.path.join(config_root, + 'etc', 'make.profile', 'deprecated') + if not os.access(deprecated_profile_file, os.R_OK): + return + dcontent = io.open(_unicode_encode(deprecated_profile_file, encoding=_encodings['fs'], errors='strict'), mode='r', encoding=_encodings['content'], errors='replace').readlines()