summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks
diff options
context:
space:
mode:
authorDaniel Schaefer <git@danielschaefer.me>2019-05-25 16:21:56 +0200
committerDaniel Schaefer <git@danielschaefer.me>2019-05-26 16:05:06 +0200
commit7c3d7521f0d3e1a2562b0b341be52639248811bb (patch)
tree0fbe1265461bd0781b578aecd2272de7b1e65b46 /pkgs/build-support/setup-hooks
parent4a1e51f957b57f781fbdd2e40ca48ebac886e974 (diff)
downloadnixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar.gz
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar.bz2
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar.lz
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar.xz
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.tar.zst
nixpkgs-7c3d7521f0d3e1a2562b0b341be52639248811bb.zip
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.
Diffstat (limited to 'pkgs/build-support/setup-hooks')
-rw-r--r--pkgs/build-support/setup-hooks/patch-shebangs.sh9
1 files changed, 7 insertions, 2 deletions
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