[reprotest] 01/01: Output a nice big obvious summary at the end, when successful

Ximin Luo infinity0 at debian.org
Thu Sep 22 19:24:39 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 77219d8a62fa9749320a6670cf3d7e437abd3019
Author: Ximin Luo <infinity0 at debian.org>
Date:   Thu Sep 22 21:23:04 2016 +0200

    Output a nice big obvious summary at the end, when successful
    
    - also fix a comment, and use `cp -a` instead of `-R`
---
 reprotest/__init__.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 5532443..e2de355 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -52,7 +52,7 @@ def start_testbed(args, temp_dir, no_clean_on_error):
     finally:
         if should_clean:
             # TODO: we could probably do *some* level of cleanup even if
-            # should_clean is True; investigate this further...
+            # should_clean is False; investigate this further...
             testbed.stop()
 
 
@@ -314,7 +314,7 @@ def build(script, source_root, dist_root, artifact_pattern, testbed, artifact_st
     # testbed.execute(['stat', source_root])
     # testbed.execute(['stat', built_artifact])
     testbed.check_exec(
-        ['sh', '-ec', 'mkdir -p "%s" && cd "%s" && cp -R -t "%s" %s && touch -d at 0 "%s" "%s"/*' %
+        ['sh', '-ec', 'mkdir -p "%s" && cd "%s" && cp -a -t "%s" %s && touch -d at 0 "%s" "%s"/*' %
         (dist_root, source_root, dist_root, artifact_pattern, dist_root, dist_root)])
     testbed.command('copyup', (dist_root, artifact_store))
 
@@ -330,6 +330,8 @@ def check(build_command, artifact_pattern, virtual_server_args, source_root,
         # TODO, why?: directories need explicit '/' appended for VirtSubproc
         tree = Pair(testbed.scratch + '/control/', testbed.scratch + '/experiment/')
         dist = Pair(testbed.scratch + '/control-dist/', testbed.scratch + '/experiment-dist/')
+        result = Pair(os.path.join(temp_dir, 'control_artifact/'),
+                      os.path.join(temp_dir, 'experiment_artifact/'))
         testbed.command('copydown', (str(source_root) + '/', tree.control))
         testbed.command('copydown', (str(source_root) + '/', tree.experiment))
         # print(source_root)
@@ -345,17 +347,23 @@ def check(build_command, artifact_pattern, virtual_server_args, source_root,
                 build(script.control, tree.control, dist.control,
                       artifact_pattern,
                       testbed,
-                      os.path.join(temp_dir, 'control_artifact/'),
+                      result.control,
                       env=env.control)
                 build(script.experiment, tree.experiment, dist.experiment,
                       artifact_pattern,
                       testbed,
-                      os.path.join(temp_dir, 'experiment_artifact/'),
+                      result.experiment,
                       env=env.experiment)
         except Exception:
             traceback.print_exc()
             return 2
-        return subprocess.check_call(['diffoscope', temp_dir + '/control_artifact', temp_dir + '/experiment_artifact'])
+        subprocess.check_call(['diffoscope', result.control, result.experiment])
+        print("=======================")
+        print("Reproduction successful")
+        print("=======================")
+        print("No differences in %s" % artifact_pattern)
+        subprocess.call(['find', '.', '-type', 'f', '-exec', 'sha256sum', '{}', ';'], cwd=result.control)
+        return 0
 
 
 COMMAND_LINE_OPTIONS = types.MappingProxyType(collections.OrderedDict([

-- 
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