[Reproducible-commits] [reprotest] 01/01: Add support for environment variable variations, locales and time zones

Ceridwen ceridwen-guest at moszumanska.debian.org
Sat Jun 4 15:59:30 UTC 2016


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

ceridwen-guest pushed a commit to branch master
in repository reprotest.

commit a8c73418262662f3efaa2c4f65ae38f82584c6cc
Author: Ceridwen <ceridwenv at gmail.com>
Date:   Sat Jun 4 11:56:04 2016 -0400

    Add support for environment variable variations, locales and time zones
---
 tests/build.py          | 27 +++++++++++++++++++++++++++
 tests/dummy_build.py    |  4 ----
 tests/irreproducible.py |  7 -------
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/tests/build.py b/tests/build.py
new file mode 100644
index 0000000..513da97
--- /dev/null
+++ b/tests/build.py
@@ -0,0 +1,27 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/gpl-3.0.en.html
+# For details: reprotest/debian/copyright
+
+import argparse
+import locale
+import os
+import tempfile
+import time
+
+if __name__ == '__main__':
+    arg_parser = argparse.ArgumentParser(
+        description='Create binaries for testing reproducibility.',
+        formatter_class=argparse.RawDescriptionHelpFormatter)
+    arg_parser.add_argument('commands', nargs='*',
+                            help='Reproducibility properties.')
+    args = set(arg_parser.parse_args().commands)
+    output = [b'']
+    if 'irreproducible' in args:
+        output.append(os.urandom(1024))
+    if 'locales' in args:
+        # print(locale.getlocale())
+        # print([l.encode('ascii') for l in locale.getlocale()])
+        output.extend(l.encode('ascii') for l in locale.getlocale())
+    if 'timezone' in args:
+        output.append(time.ctime().encode('ascii'))
+    with open('tests/artifact', 'wb') as artifact:
+        artifact.write(b''.join(output))
diff --git a/tests/dummy_build.py b/tests/dummy_build.py
deleted file mode 100755
index a4152a0..0000000
--- a/tests/dummy_build.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Licensed under the GPL: https://www.gnu.org/licenses/gpl-3.0.en.html
-# For details: reprotest/debian/copyright
-
-# Dummy build script, does nothing.
diff --git a/tests/irreproducible.py b/tests/irreproducible.py
deleted file mode 100755
index e01f847..0000000
--- a/tests/irreproducible.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Licensed under the GPL: https://www.gnu.org/licenses/gpl-3.0.en.html
-# For details: reprotest/debian/copyright
-
-import os
-
-with open('tests/irreproducible_artifact', 'wb') as irreproducible_artifact:
-    irreproducible_artifact.write(os.urandom(1024))

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