Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
Date: Tue, 01 Mar 2011 18:08:04
Message-Id: 4b4699f36bd4809ce4e8765a39b0949ec4864c2f.zmedico@gentoo
1 commit: 4b4699f36bd4809ce4e8765a39b0949ec4864c2f
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 1 18:06:01 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 1 18:06:01 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b4699f3
7
8 owners_cache: implicitly add parent directories
9
10 We can't necessarily assume that they are explicitly listed in
11 CONTENTS.
12
13 ---
14 pym/portage/dbapi/vartree.py | 19 ++++++++++++++++++-
15 1 files changed, 18 insertions(+), 1 deletions(-)
16
17 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
18 index 2e97fdb..2e5d873 100644
19 --- a/pym/portage/dbapi/vartree.py
20 +++ b/pym/portage/dbapi/vartree.py
21 @@ -823,8 +823,25 @@ class vardbapi(dbapi):
22 if not contents:
23 # Empty path is a code used to represent empty contents.
24 self._add_path("", pkg_hash)
25 +
26 + # When adding paths, implicitly add parent directories,
27 + # since we can't necessarily assume that they are
28 + # explicitly listed in CONTENTS.
29 + added_paths = set()
30 for x in contents:
31 - self._add_path(x[root_len:], pkg_hash)
32 + x = x[root_len:]
33 + added_paths.add(x)
34 + self._add_path(x, pkg_hash)
35 + x_split = x.split(os.sep)
36 + x_split.pop()
37 + while x_split:
38 + parent = os.sep.join(x_split)
39 + if parent in added_paths:
40 + break
41 + added_paths.add(parent)
42 + self._add_path(parent, pkg_hash)
43 + x_split.pop()
44 +
45 self._vardb._aux_cache["modified"].add(cpv)
46
47 def _add_path(self, path, pkg_hash):