Fix broken usage of lstrip in creating the PROFILE header field.
authorZac Medico <zmedico@gentoo.org>
Sun, 3 Jun 2007 21:48:56 +0000 (21:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 3 Jun 2007 21:48:56 +0000 (21:48 -0000)
svn path=/main/trunk/; revision=6727

pym/portage/dbapi/bintree.py

index e535f7f93d369227bf5331b76ef974d0cf19560f..31086a5c54e1aa9535e97c13e89b10389f3a4d6c 100644 (file)
@@ -740,9 +740,10 @@ 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")
+               profiles_base = os.path.join(portdir, "profiles") + os.path.sep
                profile_path = normalize_path(os.path.realpath(self.settings.profile_path))
-               profile_path = profile_path.lstrip(profiles_base)
+               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")