diff options
author | Dan Peebles <pumpkin@me.com> | 2018-09-16 13:53:45 -0400 |
---|---|---|
committer | Dan Peebles <pumpkin@me.com> | 2018-09-16 14:22:29 -0400 |
commit | 88a969d1b764968de26ad93f140cd6f35c9e90db (patch) | |
tree | ee04a2789b31c78d257b49744ee3a9d01362fff0 /pkgs/test/patch-shebangs | |
parent | 4efd4053ed183d63f09615cf30ea822e708a4fbe (diff) | |
download | nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar.gz nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar.bz2 nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar.lz nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar.xz nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.tar.zst nixlib-88a969d1b764968de26ad93f140cd6f35c9e90db.zip |
top-level/release.nix: add patchShebangs test
This is currently failing but nobody noticed!
Diffstat (limited to 'pkgs/test/patch-shebangs')
-rw-r--r-- | pkgs/test/patch-shebangs/default.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/test/patch-shebangs/default.nix b/pkgs/test/patch-shebangs/default.nix new file mode 100644 index 000000000000..a82e5e1e1982 --- /dev/null +++ b/pkgs/test/patch-shebangs/default.nix @@ -0,0 +1,26 @@ +{ stdenv, runCommand }: + +let + bad-shebang = stdenv.mkDerivation { + name = "bad-shebang"; + unpackPhase = ":"; + installPhase = '' + mkdir -p $out/bin + echo "#!/bin/sh" > $out/bin/test + echo "echo -n hello" >> $out/bin/test + chmod +x $out/bin/test + ''; + }; +in runCommand "patch-shebangs-test" { + passthru = { inherit bad-shebang; }; + meta.platforms = stdenv.lib.platforms.all; +} '' + printf "checking whether patchShebangs works properly... ">&2 + if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then + echo "yes" >&2 + touch $out + else + echo "no" >&2 + exit 1 + fi +'' \ No newline at end of file |