diff --git a/flake.nix b/flake.nix index eac499d..e614aaa 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ let system = "x86_64-linux"; in let nixpkgs = import nixpkgs-git { config = { allowUnfree = true;}; system = system; }; in - let mypackages = with nixpkgs; [ coreutils python3 sqlite gawk git file bash bashInteractive gnutar gzip ]; in + let mypackages = with nixpkgs; [ coreutils python3 sqlite gawk git file bash bashInteractive gnutar gzip gnugrep gnused ]; in with import nixpkgs-git { system = "x86_64-linux"; }; symlinkJoin { diff --git a/hash-files.py b/hash-files.py index c120642..5284741 100755 --- a/hash-files.py +++ b/hash-files.py @@ -5,7 +5,8 @@ import sys import subprocess def debug(s): - print(s, file=sys.stderr, flush=True) + #print(s, file=sys.stderr, flush=True) + pass def hashFile(filename): diff --git a/test.py b/test.py index f48e3cb..5bb3417 100755 --- a/test.py +++ b/test.py @@ -59,11 +59,9 @@ with tempfile.TemporaryDirectory(prefix="test", dir="/tmp") as tempdir: h = subprocess.check_output([os.path.abspath('./hash-files.py'), 'test/foo'], cwd=tempdir).strip() if h == b'f31eb7e1bcb25e79be0d1305d58eeadbe3fd9bf38ecbd0449789e8c91b5f4340': print("test passed: git\n", flush=True) - subprocess.check_output("tar -zcf /tmp/debug-git.tar.gz .", cwd=tempdir, shell=True) else: print("TEST FAILED: git: got hash " + repr(h) + "\n", flush=True) - subprocess.check_output("tar -zcf /tmp/debug-git.tar.gz .", cwd=tempdir, shell=True) - exit(0) + exit(1) # Sqlite with tempfile.TemporaryDirectory(prefix="test", dir="/tmp") as tempdir: @@ -96,11 +94,9 @@ with tempfile.TemporaryDirectory(prefix="test", dir="/tmp") as tempdir: h = subprocess.check_output([os.path.abspath('./hash-files.py'), 'test/foo'], cwd=tempdir).strip() if h == b'b775b5c3ad1b403c08fa88e43be42bd76143f93c26bf42cb8881c595161a5509': print("test passed: sqlite\n", flush=True) - subprocess.check_output("tar -zcf /tmp/debug-sql.tar.gz .", cwd=tempdir, shell=True) else: print("TEST FAILED: sqlite got hash " + repr(h) + "\n", flush=True) - subprocess.check_output("tar -zcf /tmp/debug-sql.tar.gz .", cwd=tempdir, shell=True) - exit(0) + exit(1) # Sqlite big table with tempfile.TemporaryDirectory(prefix="test", dir="/tmp") as tempdir: