aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorperky <perky@FreeBSD.org>2006-06-16 23:43:52 +0800
committerperky <perky@FreeBSD.org>2006-06-16 23:43:52 +0800
commit17f91268a48fc0ff0db179812510eef19f62d118 (patch)
tree81553efede9fbbb696f639dd4dd463365d59b033 /Mk
parent0ba2f540f7b2af3c65823cd5b0c79530bfaebdc4 (diff)
downloadfreebsd-ports-gnome-17f91268a48fc0ff0db179812510eef19f62d118.tar.gz
freebsd-ports-gnome-17f91268a48fc0ff0db179812510eef19f62d118.tar.zst
freebsd-ports-gnome-17f91268a48fc0ff0db179812510eef19f62d118.zip
Fence around shell execution variables not to fail abnormally when
Python segfaults. Reported by: jeff
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.python.mk10
1 files changed, 5 insertions, 5 deletions
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index 485bbf2a175c..6b011dbf4d6c 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -224,9 +224,9 @@ _PYTHON_CMD= ${PYTHON_CMD}
.else
_PYTHON_CMD= ${LOCALBASE}/bin/python
.endif
-_PYTHON_VERSION!= ${_PYTHON_CMD} -c \
+_PYTHON_VERSION!= (${_PYTHON_CMD} -c \
'import sys; print sys.version[:3]' 2> /dev/null \
- || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}
+ || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1
.endif # defined(PYTHON_VERSION)
.if !defined(USE_PYTHON)
@@ -284,11 +284,11 @@ _PYTHON_VERSION= ${_PYTHON_PORTBRANCH} # just to avoid version sanity checking.
PYTHON_VERSION?= python${_PYTHON_VERSION}
PYTHON_CMD?= ${_PYTHON_CMD}
-PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print sys.prefix') \
- 2> /dev/null || ${ECHO_CMD} ${LOCALBASE}
+PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print sys.prefix' \
+ 2> /dev/null || ${ECHO_CMD} ${LOCALBASE}) | ${TAIL} -1
DEPENDS_ARGS+= PYTHON_VERSION=${PYTHON_VERSION}
_PYTHON_PORTVERSION!= (${PYTHON_CMD} -c 'import string, sys; \
- print string.split(sys.version)[0]') 2> /dev/null || ${TRUE}
+ print string.split(sys.version)[0]' 2> /dev/null || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1
.if !defined(PYTHON_NO_DEPENDS) && !empty(_PYTHON_PORTVERSION)
PYTHON_PORTVERSION= ${_PYTHON_PORTVERSION}
.endif