From 48a61cc19483628d30346488c252008a8c646d39 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 19 Sep 2012 20:37:55 -0700 Subject: [PATCH] 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. --- .../ebuild/deprecated_profile_check.py | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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() -- 2.26.2