summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-20 11:40:55 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-20 11:40:55 +0000
commit3326e7a7e7035925186bc5ef51ebad14871abd10 (patch)
treebb5ee8c28b6798386c54238e5d99c4a34827362d
parent1190e3997b95de473763f19860ac89ea2c82943e (diff)
downloadportage-3326e7a7e7035925186bc5ef51ebad14871abd10.tar.gz
portage-3326e7a7e7035925186bc5ef51ebad14871abd10.tar.bz2
portage-3326e7a7e7035925186bc5ef51ebad14871abd10.zip
Fix binarytree._update_pkgindex_header() so that it can cope
with a missing profile. svn path=/main/trunk/; revision=8985
-rw-r--r--pym/portage/dbapi/bintree.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index c3c514a4e..e950b2052 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -785,10 +785,12 @@ class binarytree(object):
def _update_pkgindex_header(self, header):
portdir = normalize_path(os.path.realpath(self.settings["PORTDIR"]))
profiles_base = os.path.join(portdir, "profiles") + os.path.sep
- profile_path = normalize_path(os.path.realpath(self.settings.profile_path))
- if profile_path.startswith(profiles_base):
- profile_path = profile_path[len(profiles_base):]
- header["PROFILE"] = profile_path
+ if self.settings.profile_path:
+ profile_path = normalize_path(
+ os.path.realpath(self.settings.profile_path))
+ if profile_path.startswith(profiles_base):
+ profile_path = profile_path[len(profiles_base):]
+ header["PROFILE"] = profile_path
header["VERSION"] = str(self._pkgindex_version)
base_uri = self.settings.get("PORTAGE_BINHOST_HEADER_URI")
if base_uri: