From 288aa84849d9c08a422952a7ef43b58a4f12714b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 3 Jun 2008 20:37:11 +0000 Subject: [PATCH] Avoid an unhandled IndexError thrown from the PackagesSystemSet constructor when neither /etc/make.profile nor /etc/portage/profile exist. svn path=/main/trunk/; revision=10560 --- pym/portage/sets/profiles.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/portage/sets/profiles.py b/pym/portage/sets/profiles.py index 35cf4d87d..011412a53 100644 --- a/pym/portage/sets/profiles.py +++ b/pym/portage/sets/profiles.py @@ -14,8 +14,12 @@ class PackagesSystemSet(PackageSet): def __init__(self, profile_paths): super(PackagesSystemSet, self).__init__() self._profile_paths = profile_paths - self.description = "System packages for profile %s" % self._profile_paths[-1] - + if profile_paths: + description = self._profile_paths[-1] + else: + description = None + self.description = "System packages for profile %s" % description + def load(self): mylist = [grabfile_package(os.path.join(x, "packages")) for x in self._profile_paths] mylist = stack_lists(mylist, incremental=1) -- 2.26.2