[reprotest] 01/01: Add a --no-diffoscope option. (Closes: #844512)
Ximin Luo
infinity0 at debian.org
Fri Nov 18 16:15:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository reprotest.
commit 3dc708f301a576bba339131b45b39b05b51cd626
Author: Ximin Luo <infinity0 at debian.org>
Date: Fri Nov 18 17:15:33 2016 +0100
Add a --no-diffoscope option. (Closes: #844512)
---
debian/changelog | 6 ++++++
debian/control | 4 ++--
reprotest/__init__.py | 20 ++++++++++++++------
3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 76aabd6..f862c35 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+reprotest (0.3.3) UNRELEASED; urgency=medium
+
+ * Add a --no-diffoscope option. (Closes: #844512)
+
+ -- Ximin Luo <infinity0 at debian.org> Fri, 18 Nov 2016 17:13:49 +0100
+
reprotest (0.3.2) unstable; urgency=medium
* Add a --diffoscope-arg option to pass extra args to diffoscope.
diff --git a/debian/control b/debian/control
index 0c70441..b94241e 100644
--- a/debian/control
+++ b/debian/control
@@ -31,9 +31,9 @@ Depends: ${python3:Depends},
libdpkg-perl,
procps,
python3-pkg-resources,
- diffoscope,
${misc:Depends}
-Recommends: autodep8, schroot, qemu-system, qemu-utils, disorderfs, locales-all
+Recommends: diffutils | diffoscope, disorderfs, locales-all
+Suggests: autodep8, schroot, qemu-system, qemu-utils
Description: Build software and check it for reproducibility.
reprotest builds the same source code in different environments and
then checks the binaries produced by the builds to see if changing
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 04a77fa..2c9280b 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -347,9 +347,8 @@ def build(script, source_root, dist_root, artifact_pattern, testbed, artifact_st
def check(build_command, artifact_pattern, virtual_server_args, source_root,
- no_clean_on_error=False, variations=VARIATIONS, diffoscope_args=None):
- if diffoscope_args is None:
- diffoscope_args = []
+ no_clean_on_error=False, variations=VARIATIONS, diffoscope_args=[]):
+ # default argument [] is safe here because we never mutate it.
# print(virtual_server_args)
with tempfile.TemporaryDirectory() as temp_dir, \
start_testbed(virtual_server_args, temp_dir, no_clean_on_error) as testbed:
@@ -386,9 +385,13 @@ def check(build_command, artifact_pattern, virtual_server_args, source_root,
except Exception:
traceback.print_exc()
return 2
- diffoscope = ['diffoscope', result.control, result.experiment] + diffoscope_args
- print("Running diffoscope: ", diffoscope)
- retcode = subprocess.call(diffoscope)
+ if diffoscope_args is None: # don't run diffoscope
+ diffprogram = ['diff', '-ru', result.control, result.experiment]
+ print("Running diff: ", diffprogram)
+ else:
+ diffprogram = ['diffoscope', result.control, result.experiment] + diffoscope_args
+ print("Running diffoscope: ", diffprogram)
+ retcode = subprocess.call(diffprogram)
if retcode == 0:
print("=======================")
print("Reproduction successful")
@@ -445,6 +448,9 @@ COMMAND_LINE_OPTIONS = types.MappingProxyType(collections.OrderedDict([
'list (without spaces). These take precedence over what '
'you set for "variations". Default is nothing, i.e. test '
'whatever you set for "variations".'})),
+ ('--no-diffoscope', types.MappingProxyType({
+ 'action': 'store_true', 'default': False,
+ 'help': 'Don\'t run diffoscope.'})),
('--no-clean-on-error', types.MappingProxyType({
'action': 'store_true', 'default': False,
'help': 'Don\'t clean the virtual_server if there was an error. '
@@ -524,6 +530,8 @@ def main():
'no_clean_on_error',
config_options.get('no_clean_on_error'))
diffoscope_args = command_line_options.get('diffoscope_arg')
+ if command_line_options.get('no_diffoscope'):
+ diffoscope_args = None
# The default is to try all variations.
variations = frozenset(VARIATIONS.keys())
if 'variations' in config_options:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git
More information about the Reproducible-commits
mailing list