[reprotest] 02/02: Bugfix: dirname returns "" when arg is "."

Ximin Luo infinity0 at debian.org
Mon Nov 28 18:37:13 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 10f34c694ad283ff1216a9f08afbbd5fc788d7fa
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Nov 28 19:36:39 2016 +0100

    Bugfix: dirname returns "" when arg is "."
---
 reprotest/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 72faf90..67c5a6f 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -357,6 +357,8 @@ def check(build_command, artifact_pattern, virtual_server_args, source_root,
           no_clean_on_error=False, variations=VARIATIONS, diffoscope_args=[],
           testbed_pre=None, testbed_init=None):
     # default argument [] is safe here because we never mutate it.
+    if not source_root:
+        raise ValueError("invalid source root: %s" % source_root)
     # print(virtual_server_args)
     with tempfile.TemporaryDirectory() as temp_dir, \
          start_testbed(virtual_server_args, temp_dir, no_clean_on_error) as testbed:
@@ -618,7 +620,7 @@ def main(*args):
     testbed_init = command_line_options.get("testbed_init")
 
     if build_command == 'auto':
-        source_root = os.path.dirname(artifact)
+        source_root = os.path.dirname(artifact) if os.path.isfile(artifact) else artifact
         auto_preset_expr = command_line_options.get("auto_preset_expr")
         values = presets.get_presets(artifact, virtual_server_args[0])
         values = eval(auto_preset_expr, {'_':values}, {})

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