diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-16 20:43:12 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-16 20:43:12 +0000 |
commit | 6e8ac104c16227c68d12474a5a04cad971c0a1e8 (patch) | |
tree | df2be5c639f4ad546fc1b9f149f896ea23979006 | |
parent | 6734b561e020fa3786ad51ff8688425a1e72cdb8 (diff) | |
download | portage-6e8ac104c16227c68d12474a5a04cad971c0a1e8.tar.gz portage-6e8ac104c16227c68d12474a5a04cad971c0a1e8.tar.bz2 portage-6e8ac104c16227c68d12474a5a04cad971c0a1e8.zip |
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
-rw-r--r-- | pym/portage/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
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) |