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.
This commit is contained in:
parent
7bf209db50
commit
88c7b4c7fe
@ -685,14 +685,14 @@ patchShebangs() {
|
|||||||
echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)"
|
echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
newPath="$(command -v "$arg0")"
|
newPath="$(command -v "$arg0" || true)"
|
||||||
else
|
else
|
||||||
if [ "$oldPath" = "" ]; then
|
if [ "$oldPath" = "" ]; then
|
||||||
# If no interpreter is specified linux will use /bin/sh. Set
|
# If no interpreter is specified linux will use /bin/sh. Set
|
||||||
# oldpath="/bin/sh" so that we get /nix/store/.../sh.
|
# oldpath="/bin/sh" so that we get /nix/store/.../sh.
|
||||||
oldPath="/bin/sh"
|
oldPath="/bin/sh"
|
||||||
fi
|
fi
|
||||||
newPath="$(command -v "$(basename "$oldPath")")"
|
newPath="$(command -v "$(basename "$oldPath")" || true)"
|
||||||
args="$arg0 $args"
|
args="$arg0 $args"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user