Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Scripts/qa.sh
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | shebangonefile() { | ||||
interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") | interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") | ||||
badinterp="" | badinterp="" | ||||
case "${interp}" in | case "${interp}" in | ||||
"") ;; | "") ;; | ||||
/bin/rc) | /bin/rc) | ||||
# whitelist some interpreters | # whitelist some interpreters | ||||
;; | ;; | ||||
${LOCALBASE}/bin/python|${PREFIX}/bin/python) | ${LOCALBASE}/bin/python|${PREFIX}/bin/python|${LOCALBASE}/bin/python2|${PREFIX}/bin/python2|${LOCALBASE}/bin/python3|${PREFIX}/bin/python3) | ||||
badinterp="${interp}" | badinterp="${interp}" | ||||
;; | ;; | ||||
${LINUXBASE}/*) ;; | ${LINUXBASE}/*) ;; | ||||
${LOCALBASE}/bin/perl5.* | ${PREFIX}/bin/perl5.*) | ${LOCALBASE}/bin/perl5.* | ${PREFIX}/bin/perl5.*) | ||||
# lang/perl5* are allowed to have these shebangs. | # lang/perl5* are allowed to have these shebangs. | ||||
if ! expr ${PKGORIGIN} : '^lang/perl5.*' > /dev/null; then | if ! expr ${PKGORIGIN} : '^lang/perl5.*' > /dev/null; then | ||||
err "'${interp}' is an invalid shebang for '${f#${STAGEDIR}${PREFIX}/}' you must use ${LOCALBASE}/bin/perl." | err "'${interp}' is an invalid shebang for '${f#${STAGEDIR}${PREFIX}/}' you must use ${LOCALBASE}/bin/perl." | ||||
err "Either pass \${PERL} to the build or use USES=shebangfix" | err "Either pass \${PERL} to the build or use USES=shebangfix" | ||||
rc=1 | rc=1 | ||||
fi | fi | ||||
;; | ;; | ||||
${LOCALBASE}/*) ;; | ${LOCALBASE}/*) ;; | ||||
${PREFIX}/*) ;; | ${PREFIX}/*) ;; | ||||
/bin/csh) ;; | /bin/csh) ;; | ||||
/bin/sh) ;; | /bin/sh) ;; | ||||
/bin/tcsh) ;; | /bin/tcsh) ;; | ||||
/usr/bin/awk) ;; | /usr/bin/awk) ;; | ||||
/usr/bin/env) | /usr/bin/env) | ||||
interparg=$(sed -n -e '1s/^#![[:space:]]*[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") | interparg=$(sed -n -e '1s/^#![[:space:]]*[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") | ||||
case "${interparg}" in | case "${interparg}" in | ||||
python) | python|python2|python3) | ||||
badinterp="${interp} ${interparg}" | badinterp="${interp} ${interparg}" | ||||
;; | ;; | ||||
esac | esac | ||||
;; | ;; | ||||
/usr/bin/nawk) ;; | /usr/bin/nawk) ;; | ||||
/usr/bin/sed) ;; | /usr/bin/sed) ;; | ||||
/usr/sbin/dtrace) ;; | /usr/sbin/dtrace) ;; | ||||
*) | *) | ||||
▲ Show 20 Lines • Show All 791 Lines • Show Last 20 Lines |