Commit 07fe087e authored by bdrewery's avatar bdrewery
Browse files

Avoid redundantly looking up python command executions for dependency calculation.

This gets all-depends-list in x11/kde4 down to 30 seconds after the 52->41
second improvement in r399703.

With hat:	portmgr
parent c95e4996
......@@ -160,17 +160,18 @@ validate_env() {
}
export_ports_env() {
local export_vars make_cmd make_env var results value
local export_vars make_cmd make_env var results value uses
validate_env MAKE PORTSDIR
uses="perl5 python"
make_env="\
_PORTS_ENV_CHECK=1 \
PACKAGE_BUILDING=1 \
GNU_CONFIGURE=1 \
USE_JAVA=1 \
USE_LINUX=1 \
USES=perl5 \
"
make_cmd="${make_env}"
......@@ -183,6 +184,8 @@ export_ports_env() {
OPSYS \
OSREL \
OSVERSION \
PYTHON_PORTVERSION \
PYTHONBASE \
UID \
_JAVA_OS_LIST_REGEXP \
_JAVA_PORTS_INSTALLED \
......@@ -191,6 +194,7 @@ export_ports_env() {
_OSRELEASE \
_PERL5_FROM_BIN \
_PKG_CHECKED \
_PYTHON_DEFAULT_VERSION \
_SMP_CPUS \
"
......@@ -199,7 +203,8 @@ export_ports_env() {
done
# Bring in all the vars, but not empty ones.
eval $(${MAKE} -f ${PORTSDIR}/Mk/bsd.port.mk ${make_cmd} | grep -v '=$')
eval $(${MAKE} -f ${PORTSDIR}/Mk/bsd.port.mk ${make_cmd} \
USES="${uses}" | grep -v '=$')
for var in ${export_vars}; do
# Export and display non-empty ones. This is not redundant
# with above since we're looping on all vars here; do not
......
......@@ -263,9 +263,12 @@ WARNING+= "PYTHON3_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=p
.endif
.if exists(${LOCALBASE}/bin/python)
.if !defined(_PYTHON_DEFAULT_VERSION)
_PYTHON_DEFAULT_VERSION!= (${LOCALBASE}/bin/python -c \
'import sys; print("%d.%d" % sys.version_info[:2])' 2> /dev/null \
|| ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1
.endif
_EXPORTED_VARS+= _PYTHON_DEFAULT_VERSION
.if defined(PYTHON_DEFAULT) && (${PYTHON_DEFAULT} != ${_PYTHON_DEFAULT_VERSION})
WARNING+= "Your requested default python version ${PYTHON_DEFAULT} is different from the installed default python interpreter version ${_PYTHON_DEFAULT_VERSION}"
.endif
......@@ -382,7 +385,10 @@ PYTHON_MAJOR_VER= ${PYTHON_VER:R}
PYTHON_REL= # empty
PYTHON_ABIVER= # empty
PYTHON_PORTSDIR= ${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX}
.if !defined(PYTHON_PORTVERSION)
PYTHON_PORTVERSION!= ${MAKE} -V PORTVERSION -C ${PYTHON_PORTSDIR}
.endif
_EXPORTED_VARS+= PYTHON_PORTVERSION
# Create a 4 integer version string, prefixing 0 to the last token if
# it's a single character. Only use the the first 3 tokens of
# PORTVERSION to support pre-release versions (rc3, alpha4, etc) of
......@@ -395,8 +401,11 @@ PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION}
PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags
.endif
.if !defined(PYTHONBASE)
PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print(sys.prefix)' \
2> /dev/null || ${ECHO_CMD} ${LOCALBASE}) | ${TAIL} -1
.endif
_EXPORTED_VARS+= PYTHONBASE
PYTHON_INCLUDEDIR= ${PYTHONBASE}/include/python${_PYTHON_VERSION}${PYTHON_ABIVER}
PYTHON_LIBDIR= ${PYTHONBASE}/lib/python${_PYTHON_VERSION}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment