1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

- Add blacklist of files which are not intended to be executed to shebang test

- Sort shebang list

Differential Revision:	D2670
Submitted by:	amdmi3
Approved by:	portmgr (bapt)
This commit is contained in:
Dmitry Marakasov 2015-06-04 11:37:13 +00:00
parent 3a25b85d00
commit 103d62fa7a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=388526

View File

@ -23,19 +23,27 @@ shebangonefile() {
f="$@"
rc=0
# blacklist of files which are not intended to be runnable
case "${f##*/}" in
*.pm|*.pod|*.txt)
return 0
;;
esac
interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "$f")
case "$interp" in
"") ;;
/usr/bin/env) ;;
${LINUXBASE}/*) ;;
${LOCALBASE}/*) ;;
${PREFIX}/*) ;;
/usr/bin/awk) ;;
/usr/bin/sed) ;;
/usr/bin/nawk) ;;
/bin/csh) ;;
/bin/sh) ;;
/bin/tcsh) ;;
/usr/bin/awk) ;;
/usr/bin/env) ;;
/usr/bin/nawk) ;;
/usr/bin/sed) ;;
*)
err "'${interp}' is an invalid shebang you need USES=shebangfix for '${f#${STAGEDIR}${PREFIX}/}'"
rc=1