summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-03-01 10:06:01 -0800
committerZac Medico <zmedico@gentoo.org>2011-03-01 12:53:53 -0800
commit908f430504c6142a0c0e452e9d9a9dcd808f87c6 (patch)
treee5cd2ff9a94a18421ef874bdb3cf70d8fc41ac02 /pym
parent33b6ee0f8e60d4940f270a06de48bd5bbee45a0d (diff)
downloadportage-908f430504c6142a0c0e452e9d9a9dcd808f87c6.tar.gz
portage-908f430504c6142a0c0e452e9d9a9dcd808f87c6.tar.bz2
portage-908f430504c6142a0c0e452e9d9a9dcd808f87c6.zip
owners_cache: implicitly add parent directories
We can't necessarily assume that they are explicitly listed in CONTENTS.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 9be12fb3e..b8881c817 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -822,8 +822,25 @@ class vardbapi(dbapi):
if not contents:
# Empty path is a code used to represent empty contents.
self._add_path("", pkg_hash)
+
+ # When adding paths, implicitly add parent directories,
+ # since we can't necessarily assume that they are
+ # explicitly listed in CONTENTS.
+ added_paths = set()
for x in contents:
- self._add_path(x[root_len:], pkg_hash)
+ x = x[root_len:]
+ added_paths.add(x)
+ self._add_path(x, pkg_hash)
+ x_split = x.split(os.sep)
+ x_split.pop()
+ while x_split:
+ parent = os.sep.join(x_split)
+ if parent in added_paths:
+ break
+ added_paths.add(parent)
+ self._add_path(parent, pkg_hash)
+ x_split.pop()
+
self._vardb._aux_cache["modified"].add(cpv)
def _add_path(self, path, pkg_hash):