brp-mangle-shebangs: fix mangling absolute paths in /.../env

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-02-07 18:11:42 +01:00
parent d2cc76421f
commit 35f7182912
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

View File

@ -34,6 +34,8 @@ for f in $(find -executable -type f | xargs --no-run-if-empty file -N --mime-typ
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@')