From 7c3d7521f0d3e1a2562b0b341be52639248811bb Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 25 May 2019 16:21:56 +0200 Subject: patchShebangs: Exit if no arguments were given Commit "patchShebangs: Allow for multiple arguments" 4a1e51f957b57f78 removed the check. We don't want to break existing usages so this introduces it again with a successful exit code. --- pkgs/build-support/setup-hooks/patch-shebangs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkgs') diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index 3a879db2c0a..3e900d0704c 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -32,7 +32,7 @@ patchShebangs() { shift fi - header "patching script interpreter paths in $@" + echo "patching script interpreter paths in $@" local f local oldPath local newPath @@ -41,6 +41,11 @@ patchShebangs() { local oldInterpreterLine local newInterpreterLine + if [ $# -eq 0 ]; then + echo "No arguments supplied to patchShebangs" >0 + return 0 + fi + local f while IFS= read -r -d $'\0' f; do isScript "$f" || continue @@ -61,7 +66,7 @@ patchShebangs() { # - options: something starting with a '-' # - environment variables: foo=bar if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" >0 exit 1 fi -- cgit 1.4.1