[reprotest] 01/02: Add a bit more variety to the faketime variation whilst trying to avoid bad behaviours

Ximin Luo infinity0 at debian.org
Thu Jan 5 16:23:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository reprotest.

commit e925901430544d4dd19d41f791baa6afb4cfaa50
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Dec 19 18:32:55 2016 +0100

    Add a bit more variety to the faketime variation whilst trying to avoid bad behaviours
---
 reprotest/__init__.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 56b77a0..1ec9f17 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -315,8 +315,15 @@ def faketime(script, env, tree, source_root):
     # However if you're building this too soon after changing one of the source
     # files then the effect of this variation is not very great.
     filemtimes = (os.path.getmtime(os.path.join(root, f)) for root, dirs, files in os.walk(source_root) for f in files)
-    t = int(max(filemtimes, default=time.time()))
-    settime = _shell_ast.SimpleCommand.make('faketime', '@%s'%t)
+    now = time.time()
+    lastmt = int(max(filemtimes, default=now))
+    if lastmt < now - 18429180:
+        # if lastmt is far in the past, use that, it's a bit safer
+        faket = '@%s' % lastmt
+    else:
+        # otherwise use a date far in the future
+        faket = '+213days+7hours+13minutes'
+    settime = _shell_ast.SimpleCommand.make('faketime', faket)
     new_experiment = script.experiment.append_command(settime)
     # faketime's manpages are stupidly misleading; it also modifies file timestamps.
     # this is only mentioned in the README. we do not want this, it really really

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