From 6e8ac104c16227c68d12474a5a04cad971c0a1e8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 16 Jul 2008 20:43:12 +0000 Subject: [PATCH] Avoid raising an IndexError from deprecated_profile_check() if the deprecated file happens to be empty. Instead just refer to the "Gentoo Upgrading Guide". Thanks to armin76 for reporting. svn path=/main/trunk/; revision=11088 --- pym/portage/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 7e8cc30a8..52273bd73 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -6808,9 +6808,13 @@ def deprecated_profile_check(): 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"), noiselevel=-1) + if not dcontent: + writemsg(red("!!! Please refer to the Gentoo Upgrading Guide.\n"), + noiselevel=-1) + return True + newprofile = dcontent[0] writemsg(red("!!! Please upgrade to the following profile if possible:\n"), noiselevel=-1) writemsg(8*" "+green(newprofile)+"\n", noiselevel=-1) -- 2.26.2