1 |
commit: 1ea61accd6003965c6a1e55285f7fed7b0587014 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 1 21:04:41 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 1 21:05:21 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ea61acc |
7 |
|
8 |
owners_cache: fix EPREFIX miscalculation |
9 |
|
10 |
This reverts commit 43e0b3ea4289aab9b4258d29d06afac40abd6c01 and |
11 |
renames the root_len variable to eroot_len (for clarity). |
12 |
|
13 |
--- |
14 |
pym/portage/dbapi/vartree.py | 8 +++----- |
15 |
1 files changed, 3 insertions(+), 5 deletions(-) |
16 |
|
17 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
18 |
index dc1925d..fdfbc77 100644 |
19 |
--- a/pym/portage/dbapi/vartree.py |
20 |
+++ b/pym/portage/dbapi/vartree.py |
21 |
@@ -814,11 +814,9 @@ class vardbapi(dbapi): |
22 |
|
23 |
def __init__(self, vardb): |
24 |
self._vardb = vardb |
25 |
- self._eprefix_split_len = len(x for x in \ |
26 |
- vardb.settings["EPREFIX"].split(os.sep) if x) |
27 |
|
28 |
def add(self, cpv): |
29 |
- root_len = len(self._vardb._eroot) |
30 |
+ eroot_len = len(self._vardb._eroot) |
31 |
contents = self._vardb._dblink(cpv).getcontents() |
32 |
pkg_hash = self._hash_pkg(cpv) |
33 |
if not contents: |
34 |
@@ -830,12 +828,12 @@ class vardbapi(dbapi): |
35 |
# explicitly listed in CONTENTS. |
36 |
added_paths = set() |
37 |
for x in contents: |
38 |
- x = x[root_len:] |
39 |
+ x = x[eroot_len:] |
40 |
added_paths.add(x) |
41 |
self._add_path(x, pkg_hash) |
42 |
x_split = x.split(os.sep) |
43 |
x_split.pop() |
44 |
- while len(x_split) > self._eprefix_split_len: |
45 |
+ while x_split: |
46 |
parent = os.sep.join(x_split) |
47 |
if parent in added_paths: |
48 |
break |