mirror of
https://github.com/NixOS/nix.git
synced 2025-12-15 13:31:05 +01:00
tests/run.sh: Check that env is mostly unmodified
This commit is contained in:
parent
e0b4691754
commit
68b8a28bc4
2 changed files with 43 additions and 0 deletions
|
|
@ -55,4 +55,26 @@ rec {
|
|||
chmod +x $out/bin/hello
|
||||
'';
|
||||
};
|
||||
|
||||
# execs env from PATH, so that we can probe the environment
|
||||
# does not allow arguments, because we don't need them
|
||||
env = mkDerivation {
|
||||
name = "env";
|
||||
outputs = [ "out" ];
|
||||
buildCommand =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
|
||||
cat > $out/bin/env <<EOF
|
||||
#! ${shell}
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "env: Unexpected arguments ($#): $@" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
exec env
|
||||
EOF
|
||||
chmod +x $out/bin/env
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue