diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-06-03 20:37:11 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-06-03 20:37:11 +0000 |
commit | 288aa84849d9c08a422952a7ef43b58a4f12714b (patch) | |
tree | d5be207743034679e62049ffd07efc45009a8351 | |
parent | 2646bca31e14f042c825bff30f1de204fd3f5027 (diff) | |
download | portage-288aa84849d9c08a422952a7ef43b58a4f12714b.tar.gz portage-288aa84849d9c08a422952a7ef43b58a4f12714b.tar.bz2 portage-288aa84849d9c08a422952a7ef43b58a4f12714b.zip |
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
-rw-r--r-- | pym/portage/sets/profiles.py | 8 |
1 files 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) |