avoid weird error message if something defines MODPY_VERSION to a bad value,

by making sure we're a valid value before we try a numerical test.
This commit is contained in:
espie 2011-10-17 13:55:24 +00:00
parent 5bed7cb23f
commit 009a1a9376

View File

@ -1,4 +1,4 @@
# $OpenBSD: python.port.mk,v 1.46 2011/10/03 13:54:12 fgsch Exp $
# $OpenBSD: python.port.mk,v 1.47 2011/10/17 13:55:24 espie Exp $
#
# python.port.mk - Xavier Santolaria <xavier@santolaria.net>
# This file is in the public domain.
@ -9,17 +9,23 @@ CATEGORIES+= lang/python
MODPY_VERSION?= 2.7
.if ${MODPY_VERSION} < 2.6
.if ${MODPY_VERSION} == "2.4" || ${MODPY_VERSION} == "2.5" || ${MODPY_VERSION} == "2.7" || ${MODPY_VERSION} == "3.2"
. if ${MODPY_VERSION} < 2.6
MODPY_JSON = devel/py-simplejson
.else
. else
MODPY_JSON =
. endif
. if ${MODPY_VERSION} < 3.2
MODPY_WANTLIB = python${MODPY_VERSION}
. else
MODPY_WANTLIB = python${MODPY_VERSION}m
. endif
.else
ERRORS += "Fatal: unknown or unsupported MODPY_VERSION: ${MODPY_VERSION}"
.endif
.if ${MODPY_VERSION} < 3.2
MODPY_WANTLIB = python${MODPY_VERSION}
.else
MODPY_WANTLIB = python${MODPY_VERSION}m
.endif
MODPY_RUN_DEPENDS= lang/python/${MODPY_VERSION}
MODPY_LIB_DEPENDS= ${MODPY_RUN_DEPENDS}
_MODPY_BUILD_DEPENDS= ${MODPY_RUN_DEPENDS}