aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbrp-mangle-shebangs8
1 files changed, 4 insertions, 4 deletions
diff --git a/brp-mangle-shebangs b/brp-mangle-shebangs
index 5343519..f27ad73 100755
--- a/brp-mangle-shebangs
+++ b/brp-mangle-shebangs
@@ -137,10 +137,10 @@ while IFS= read -r line; do
fi
# Replace "special" env shebang:
- # /whatsoever/env /whatever/foo → /whatever/foo
- shebang=$(echo "$shebang" | sed -r -e 's@^(.+)/env /(.+)$@/\2@')
- # /whatsoever/env foo → /whatsoever/foo
- shebang=$(echo "$shebang" | sed -r -e 's@^(.+/)env (.+)$@\1\2@')
+ # /whatsoever/env -whatever /whatever/foo → /whatever/foo
+ shebang=$(echo "$shebang" | sed -r -e 's@^(.+)/env( -[^ ]+)* /(.+)$@/\3@')
+ # /whatsoever/env -whatever foo → /whatsoever/foo
+ shebang=$(echo "$shebang" | sed -r -e 's@^(.+/)env( -[^ ]+)* (.+)$@\1\3@')
# If the shebang now starts with /bin, change it to /usr/bin
# https://bugzilla.redhat.com/show_bug.cgi?id=1581757