From: Zac Medico Date: Tue, 1 Mar 2011 21:04:41 +0000 (-0800) Subject: owners_cache: fix EPREFIX miscalculation X-Git-Tag: v2.1.9.42~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ea61accd6003965c6a1e55285f7fed7b0587014;p=portage.git owners_cache: fix EPREFIX miscalculation This reverts commit 43e0b3ea4289aab9b4258d29d06afac40abd6c01 and renames the root_len variable to eroot_len (for clarity). --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index dc1925d14..fdfbc7710 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -814,11 +814,9 @@ class vardbapi(dbapi): def __init__(self, vardb): self._vardb = vardb - self._eprefix_split_len = len(x for x in \ - vardb.settings["EPREFIX"].split(os.sep) if x) def add(self, cpv): - root_len = len(self._vardb._eroot) + eroot_len = len(self._vardb._eroot) contents = self._vardb._dblink(cpv).getcontents() pkg_hash = self._hash_pkg(cpv) if not contents: @@ -830,12 +828,12 @@ class vardbapi(dbapi): # explicitly listed in CONTENTS. added_paths = set() for x in contents: - x = x[root_len:] + x = x[eroot_len:] added_paths.add(x) self._add_path(x, pkg_hash) x_split = x.split(os.sep) x_split.pop() - while len(x_split) > self._eprefix_split_len: + while x_split: parent = os.sep.join(x_split) if parent in added_paths: break