From 103d62fa7ae2daead25d97a45aa3419542e9f657 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Thu, 4 Jun 2015 11:37:13 +0000 Subject: [PATCH] - 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) --- Mk/Scripts/qa.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index d1c98093f1d9..0a4c96ebba29 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -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