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