[reprotest] 05/05: Remove any existing artifact, in case the build script doesn't overwrite it

Ximin Luo infinity0 at debian.org
Fri Sep 23 18:32:51 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 6b25439b25dd3a1442cd306e274cd5c0ad64cbd2
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Sep 23 20:30:21 2016 +0200

    Remove any existing artifact, in case the build script doesn't overwrite it
---
 reprotest/__init__.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index f973e8a..93af791 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -288,12 +288,15 @@ VARIATIONS = types.MappingProxyType(collections.OrderedDict([
 
 
 def build(script, source_root, dist_root, artifact_pattern, testbed, artifact_store, env):
-    # TODO: we should probably `rm -f artifact_pattern` in case the
-    # build script doesn't overwrite like how make(1) sometimes works.
     print(source_root)
     # testbed.execute(['ls', '-l', source_root])
     # testbed.execute(['pwd'])
     print(artifact_pattern)
+    # remove any existing artifact, in case the build script doesn't overwrite
+    # it e.g. like how make(1) sometimes works.
+    testbed.check_exec(
+        ['sh', '-ec', 'cd "%s" && rm -rf %s' %
+        (source_root, artifact_pattern)])
     # cd = _shell_ast.SimpleCommand('', 'cd', _shell_ast.CmdSuffix([source_root]))
     # new_script = (_shell_ast.List([_shell_ast.Term(cd, ';')]) + script)
     cd = _shell_ast.SimpleCommand.make('cd', source_root)

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