1 |
commit: 7d7248470d42f034184249f96995762b3b27f227 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 17 17:43:38 2015 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 21 16:10:42 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7d724847 |
7 |
|
8 |
Manifest._apply_max_mtime: include all dirs (bug 567920) |
9 |
|
10 |
Commit 3c2cce57700e8a2be4774d653cd632d9e59aab78 only included direct |
11 |
parent directories of files listed in the manifest. In order to account |
12 |
for changes to directories that only contain directories, include all |
13 |
directories in the max mtime calculation for thick manifests. |
14 |
|
15 |
Fixes: 3c2cce57700e ("Manifest._apply_max_mtime: account for removals and renames (bug 567920)") |
16 |
X-Gentoo-Bug: 567920 |
17 |
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=567920 |
18 |
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org> |
19 |
|
20 |
pym/portage/manifest.py | 20 +++++++++++++++----- |
21 |
1 file changed, 15 insertions(+), 5 deletions(-) |
22 |
|
23 |
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py |
24 |
index 3a6bc7e..f696f84 100644 |
25 |
--- a/pym/portage/manifest.py |
26 |
+++ b/pym/portage/manifest.py |
27 |
@@ -362,7 +362,6 @@ class Manifest(object): |
28 |
for stat_result in preserved_stats.values(): |
29 |
max_mtime = _update_max(stat_result) |
30 |
|
31 |
- dirs = set() |
32 |
for entry in entries: |
33 |
if entry.type == 'DIST': |
34 |
continue |
35 |
@@ -370,10 +369,21 @@ class Manifest(object): |
36 |
entry.type == 'AUX' else os.path.join(self.pkgdir, entry.name)) |
37 |
max_mtime = _update_max(_stat(abs_path)) |
38 |
|
39 |
- parent_dir = os.path.dirname(abs_path) |
40 |
- if parent_dir not in dirs: |
41 |
- dirs.add(parent_dir) |
42 |
- max_mtime = _update_max(_stat(parent_dir)) |
43 |
+ if not self.thin: |
44 |
+ # Account for changes to all relevant nested directories. |
45 |
+ # This is not necessary for thin manifests because |
46 |
+ # self.pkgdir is already included via preserved_stats. |
47 |
+ for parent_dir, dirs, files in os.walk(self.pkgdir.rstrip(os.sep)): |
48 |
+ try: |
49 |
+ parent_dir = _unicode_decode(parent_dir, |
50 |
+ encoding=_encodings['fs'], errors='strict') |
51 |
+ except UnicodeDecodeError: |
52 |
+ # If an absolute path cannot be decoded, then it is |
53 |
+ # always excluded from the manifest (repoman will |
54 |
+ # report such problems). |
55 |
+ pass |
56 |
+ else: |
57 |
+ max_mtime = _update_max(_stat(parent_dir)) |
58 |
|
59 |
if max_mtime is not None: |
60 |
for path in preserved_stats: |