[Piuparts-commits] [piuparts] 02/03: p: silence diff_meta_data() for "others" for --warn-on-others
Holger Levsen
holger at layer-acht.org
Fri Aug 4 00:35:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 35858e9bff6d76885c1f7d9e77e5b40d8fbc84c1
Author: Andreas Beckmann <anbe at debian.org>
Date: Thu Aug 3 21:19:18 2017 +0200
p: silence diff_meta_data() for "others" for --warn-on-others
may output duplicate or misleading information
Signed-off-by: Andreas Beckmann <anbe at debian.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
debian/changelog | 1 +
piuparts.py | 13 +++++++------
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 83751d4..e3304a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ piuparts (0.79) UNRELEASED; urgency=medium
- Do not ignore errors while purging packages.
- Add post_test_* custom scripts. These are run exactly once at the end
of each test (before comparing with the reference chroot state).
+ - Silence diff_meta_data() for "others" for --warn-on-others.
* piuparts.conf:
- Use relative expiration ages.
* reschedule_oldest_logs: Expiration age values starting with "+" are
diff --git a/piuparts.py b/piuparts.py
index 69d8852..b6f3240 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -2196,7 +2196,7 @@ def format_object_attributes(obj):
return res
-def diff_meta_data(tree1, tree2):
+def diff_meta_data(tree1, tree2, quiet=False):
"""Compare two dir trees and return list of new files (only in 'tree2'),
removed files (only in 'tree1'), and modified files."""
@@ -2205,7 +2205,7 @@ def diff_meta_data(tree1, tree2):
for name in settings.ignored_files:
if name[0] == ':':
- verbose = True
+ verbose = not quiet
name = name[1:]
else:
verbose = False
@@ -2220,7 +2220,7 @@ def diff_meta_data(tree1, tree2):
for pattern in settings.ignored_patterns:
if pattern[0] == ':':
- verbose = True
+ verbose = not quiet
pattern = pattern[1:]
else:
verbose = False
@@ -2242,8 +2242,9 @@ def diff_meta_data(tree1, tree2):
for name in tree1.keys()[:]:
if name in tree2:
if objects_are_different(tree1[name], tree2[name]):
- logging.debug("Modified(user, group, mode, size, target): %s expected%s != found%s" %
- (name, format_object_attributes(tree1[name]), format_object_attributes(tree2[name])))
+ if not quiet:
+ logging.debug("Modified(user, group, mode, size, target): %s expected%s != found%s" %
+ (name, format_object_attributes(tree1[name]), format_object_attributes(tree2[name])))
modified.append((name, tree1[name]))
del tree1[name]
del tree2[name]
@@ -2423,7 +2424,7 @@ def check_results(chroot, chroot_state, file_owners, deps_info=None):
if settings.warn_on_others and deps_info is not None:
(new, removed, modified) = diff_meta_data(reference_info, current_info)
(depsnew, depsremoved, depsmodified) = diff_meta_data(reference_info,
- deps_info)
+ deps_info, quiet=True)
warnnew = prune_files_list(new, depsnew)
warnremoved = prune_files_list(removed, depsremoved)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list