View | Details | Raw Unified | Return to bug 255013 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/Uses/python.mk (-13 / +18 lines)
Lines 337-359 _PYTHON_ARGS= 3.6+ Link Here
337
.endif
337
.endif
338
338
339
# Validate Python version whether it meets the version restriction.
339
# Validate Python version whether it meets the version restriction.
340
_PYTHON_VERSION_CHECK:=		${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/}
340
_PYTHON_VERSION_CHECK:=		${_PYTHON_ARGS:C/^([1-9]\.[1-9]?[0-9])$/\1-\1/}
341
_PYTHON_VERSION_MINIMUM_TMP:=	${_PYTHON_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/}
341
_PYTHON_VERSION_MINIMUM_TMP:=	${_PYTHON_VERSION_CHECK:C/([1-9]\.[1-9]?[0-9])[-+].*/\1/}
342
_PYTHON_VERSION_MINIMUM:=	${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]}
342
_PYTHON_VERSION_MINIMUM:=	${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]}${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[1-9][0-9]}
343
_PYTHON_VERSION_MAXIMUM_TMP:=	${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/}
343
_PYTHON_VERSION_MAXIMUM_TMP:=	${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[1-9]?[0-9])/\1/}
344
_PYTHON_VERSION_MAXIMUM:=	${_PYTHON_VERSION_MAXIMUM_TMP:M[1-9].[0-9]}
344
_PYTHON_VERSION_MAXIMUM:=	${_PYTHON_VERSION_MAXIMUM_TMP:M[1-9].[0-9]}${_PYTHON_VERSION_MAXIMUM_TMP:M[1-9].[1-9][0-9]}
345
345
346
# At this point we should have no argument left in ${_PYTHON_ARGS}
346
# At this point we should have no argument left in ${_PYTHON_ARGS}
347
# except a version spec
347
# except a version spec
348
_PYTHON_ARGS:=	${_PYTHON_ARGS:N[1-9].[0-9]-[1-9].[0-9]:N[1-9].[0-9]:N[1-9].[0-9]+:N-[1-9].[0-9]}
348
_V1=		[1-9].[0-9]
349
_V2=		[1-9].[1-9][0-9]
350
_PYTHON_ARGS:=	${_PYTHON_ARGS:N${_V1}-${_V1}:N${_V1}-${_V2}:N${_V2}-${_V2}:N${_V1}:N${_V2}:N${_V1}+:N${_V2}+:N-${_V1}:N-${_V2}}
349
.if !empty(_PYTHON_ARGS)
351
.if !empty(_PYTHON_ARGS)
350
IGNORE=	uses unknown USES=python arguments: ${_PYTHON_ARGS}
352
IGNORE=	uses unknown USES=python arguments: ${_PYTHON_ARGS}
351
.endif
353
.endif
352
354
355
# Pattern to convert python versions (X.Y or X.YY) to comparable format X.YY
356
_VC=		C/^([1-9]\.)([0-9])$$/\10\2/
357
353
.undef _PYTHON_VERSION_NONSUPPORTED
358
.undef _PYTHON_VERSION_NONSUPPORTED
354
.if !empty(_PYTHON_VERSION_MINIMUM) && (${_PYTHON_VERSION} < ${_PYTHON_VERSION_MINIMUM})
359
.if !empty(_PYTHON_VERSION_MINIMUM) && (${_PYTHON_VERSION:${_VC}} < ${_PYTHON_VERSION_MINIMUM:${_VC}})
355
_PYTHON_VERSION_NONSUPPORTED=	${_PYTHON_VERSION_MINIMUM} at least
360
_PYTHON_VERSION_NONSUPPORTED=	${_PYTHON_VERSION_MINIMUM} at least
356
.elif !empty(_PYTHON_VERSION_MAXIMUM) && (${_PYTHON_VERSION} > ${_PYTHON_VERSION_MAXIMUM})
361
.elif !empty(_PYTHON_VERSION_MAXIMUM) && (${_PYTHON_VERSION:${_VC}} > ${_PYTHON_VERSION_MAXIMUM:${_VC}})
357
_PYTHON_VERSION_NONSUPPORTED=	${_PYTHON_VERSION_MAXIMUM} at most
362
_PYTHON_VERSION_NONSUPPORTED=	${_PYTHON_VERSION_MAXIMUM} at most
358
.endif
363
.endif
359
364
Lines 364-372 _PYTHON_VERSION_NONSUPPORTED= ${_PYTHON_VERSION_MAXIMUM} at most Link Here
364
__VER=		${ver}
369
__VER=		${ver}
365
.if !defined(_PYTHON_VERSION) && \
370
.if !defined(_PYTHON_VERSION) && \
366
	!(!empty(_PYTHON_VERSION_MINIMUM) && ( \
371
	!(!empty(_PYTHON_VERSION_MINIMUM) && ( \
367
		${__VER} < ${_PYTHON_VERSION_MINIMUM})) && \
372
		${__VER:${_VC}} < ${_PYTHON_VERSION_MINIMUM:${_VC}})) && \
368
	!(!empty(_PYTHON_VERSION_MAXIMUM) && ( \
373
	!(!empty(_PYTHON_VERSION_MAXIMUM) && ( \
369
		${__VER} > ${_PYTHON_VERSION_MAXIMUM}))
374
		${__VER:${_VC}} > ${_PYTHON_VERSION_MAXIMUM:${_VC}}))
370
_PYTHON_VERSION=	${ver}
375
_PYTHON_VERSION=	${ver}
371
.endif
376
.endif
372
.endfor
377
.endfor
Lines 381-389 IGNORE= needs an unsupported version of Python Link Here
381
.  for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
386
.  for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
382
__VER=		${ver}
387
__VER=		${ver}
383
.    if !(!empty(_PYTHON_VERSION_MINIMUM) && ( \
388
.    if !(!empty(_PYTHON_VERSION_MINIMUM) && ( \
384
		${__VER} < ${_PYTHON_VERSION_MINIMUM})) && \
389
		${__VER:${_VC}} < ${_PYTHON_VERSION_MINIMUM:${_VC}})) && \
385
	!(!empty(_PYTHON_VERSION_MAXIMUM) && ( \
390
	!(!empty(_PYTHON_VERSION_MAXIMUM) && ( \
386
		${__VER} > ${_PYTHON_VERSION_MAXIMUM}))
391
		${__VER:${_VC}} > ${_PYTHON_VERSION_MAXIMUM:${_VC}}))
387
.      if empty(_VALID_PYTHON_VERSIONS:M${ver})
392
.      if empty(_VALID_PYTHON_VERSIONS:M${ver})
388
_VALID_PYTHON_VERSIONS+=	${ver}
393
_VALID_PYTHON_VERSIONS+=	${ver}
389
.      endif
394
.      endif
Lines 416-422 FLAVOR= ${FLAVORS:[1]} Link Here
416
.  endif
421
.  endif
417
.endif
422
.endif
418
423
419
.if ${FLAVOR:Mpy[23][0-9]}
424
.if ${FLAVOR:Mpy[23][0-9]}${FLAVOR:Mpy[23][1-9][0-9]}
420
_PYTHON_VERSION=	${FLAVOR:S/py//:C/(.)/\1./}
425
_PYTHON_VERSION=	${FLAVOR:S/py//:C/(.)/\1./}
421
.endif
426
.endif
422
427

Return to bug 255013