aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2017-12-21 21:27:51 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2017-12-21 21:27:51 +0800
commit33899a50033390f6082ad368fdf6c1ce43de4f09 (patch)
treeb7b384f03bfa5a55a80da138e1fe6964433bd4e6 /Mk
parent9d6ee1aba63b6e432d7e373a1185d049fcb13445 (diff)
downloadfreebsd-ports-gnome-33899a50033390f6082ad368fdf6c1ce43de4f09.tar.gz
freebsd-ports-gnome-33899a50033390f6082ad368fdf6c1ce43de4f09.tar.zst
freebsd-ports-gnome-33899a50033390f6082ad368fdf6c1ce43de4f09.zip
Report (in q/a) and fix (in shebangfix) python[23] shebangs
Currently, only python shebangs (e.g. /bin/python, /usr/local/bin/python, /usr/bin/env python etc.) are reported by stage Q/A and fixed by USES=shebangfix. We need to do the same for python[23] as well. Before the problem was not noticeable since many ports had e.g. USES=python:2, which added a dependency on python2 metaport, however that's going to switch to USES=python:2.7, and neither it, nor more widely used USES=python adds a dependency on metaports, so there's very high probability that python[23] links are not available. Approved by: portmgr (mat) Differential Revision: https://reviews.freebsd.org/D13571
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/qa.sh4
-rw-r--r--Mk/Uses/shebangfix.mk7
2 files changed, 9 insertions, 2 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index 87f2b23d689b..4ffb986fdb4e 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -48,7 +48,7 @@ shebangonefile() {
/bin/rc)
# 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}"
;;
${LINUXBASE}/*) ;;
@@ -69,7 +69,7 @@ shebangonefile() {
/usr/bin/env)
interparg=$(sed -n -e '1s/^#![[:space:]]*[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}")
case "${interparg}" in
- python)
+ python|python2|python3)
badinterp="${interp} ${interparg}"
;;
esac
diff --git a/Mk/Uses/shebangfix.mk b/Mk/Uses/shebangfix.mk
index 5cf726ee499e..03a7649f033f 100644
--- a/Mk/Uses/shebangfix.mk
+++ b/Mk/Uses/shebangfix.mk
@@ -65,6 +65,13 @@ ${lang}_OLD_CMD+= /usr/bin/${lang}
${lang}_OLD_CMD+= /usr/local/bin/${lang}
.endfor
+.for pyver in 2 3
+python_OLD_CMD+= "/usr/bin/env python${pyver}"
+python_OLD_CMD+= /bin/python${pyver}
+python_OLD_CMD+= /usr/bin/python${pyver}
+python_OLD_CMD+= /usr/local/bin/python${pyver}
+.endfor
+
.for lang in ${SHEBANG_LANG}
. if !defined(${lang}_CMD)
IGNORE+= missing definition for ${lang}_CMD