Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 2015 08:28:58 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r396885 - head/Mk/Uses
Message-ID:  <201509140828.t8E8SwgQ047318@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Mon Sep 14 08:28:57 2015
New Revision: 396885
URL: https://svnweb.freebsd.org/changeset/ports/396885

Log:
  Uses/python.mk: Fix PYTHON_REL for pre-release Python versions
  
  Modify the PYTHON_REL variable assignment in python.mk so that it
  can support PORTVERSION's that have non-integer suffixes such as
  the current lang/python35 version (PORTVERSION currently 3.5.0.r3).
  
  Currently, ports that use PYTHON_REL while DEFAULT_VERSIONS is set to
  3.5, fail to build with the following make error:
  
  make: "/usr/ports/Mk/Uses/python.mk" line 503:
  warning: String comparison operator should be either == or !=
  make: "/usr/ports/Mk/Uses/python.mk" line 503:
  Malformed conditional (${PYTHON_REL} >= 3200 && defined(_PYTHON_FEATURE_PY3KPLIST))
  
  This is caused by a non-integer value ("r3") in PYTHON_REL.
  
  While I'm here, add a comment block to be clear on what we
  (currently) want to achieve.
  
  PR:			203093
  Reported by:		Andrew Berg (aberg010 my.hennepintech.edu)
  Reviewed by:		antoine
  MFH:			2015Q3
  Differential Revision:	https://reviews.freebsd.org/D3662

Modified:
  head/Mk/Uses/python.mk

Modified: head/Mk/Uses/python.mk
==============================================================================
--- head/Mk/Uses/python.mk	Mon Sep 14 07:59:41 2015	(r396884)
+++ head/Mk/Uses/python.mk	Mon Sep 14 08:28:57 2015	(r396885)
@@ -383,7 +383,11 @@ PYTHON_REL=		# empty
 PYTHON_ABIVER=		# empty
 PYTHON_PORTSDIR=	${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX}
 PYTHON_PORTVERSION!=	${MAKE} -V PORTVERSION -C ${PYTHON_PORTSDIR}
-PYTHON_REL=		${PYTHON_PORTVERSION:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g}
+# 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
+# any Python port (lang/pythonXY)
+PYTHON_REL=	${PYTHON_PORTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g}
 
 # Might be overridden by calling ports
 PYTHON_CMD?=		${_PYTHON_BASECMD}${_PYTHON_VERSION}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509140828.t8E8SwgQ047318>