From 88c7b4c7fee42c1ae5167fd1e7806d600e4451e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Tue, 3 Dec 2013 16:58:49 +0100 Subject: [PATCH] Fix bug introduced in previous commit When building e.g. perl for the first time there is no perl in PATH yet, so command -v perl will fail. This brings back the previous behaviour of silently not patching shebangs for which there is no available command in PATH. --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 3cc84c9db5e..1ed905db363 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -685,14 +685,14 @@ patchShebangs() { echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" exit 1 fi - newPath="$(command -v "$arg0")" + newPath="$(command -v "$arg0" || true)" else if [ "$oldPath" = "" ]; then # If no interpreter is specified linux will use /bin/sh. Set # oldpath="/bin/sh" so that we get /nix/store/.../sh. oldPath="/bin/sh" fi - newPath="$(command -v "$(basename "$oldPath")")" + newPath="$(command -v "$(basename "$oldPath")" || true)" args="$arg0 $args" fi