brp-mangle-shebangs: Simplify/Fix check for shebang starting with "/"

Reported-by: Jun Aruga <jaruga@redhat.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1541057
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-02-08 10:38:40 +01:00
parent 8444cee8f3
commit 51f1c66748
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
2 changed files with 5 additions and 2 deletions

View File

@ -23,7 +23,7 @@ for f in $(find -executable -type f | xargs --no-run-if-empty file -N --mime-typ
chmod -x "$f"
touch -d "$ts" "$f"
continue
elif [ "${shebang%${shebang#?}}" != "/" ]; then
elif [ -n "${shebang##/*}" ]; then
echo >&2 "*** ERROR: $f has shebang which doesn't start with '/' ($shebang)"
fail=1
continue

View File

@ -6,7 +6,7 @@
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 95
Version: 96
Release: 1%{?dist}
# No version specified.
License: GPL+
@ -183,6 +183,9 @@ install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
%{_rpmconfigdir}/macros.d/macros.kmp
%changelog
* Thu Feb 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 96-1
- Simplify/Fix check for shebang starting with "/"
* Wed Feb 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 95-1
- Fix mangling env shebangs with absolute paths