Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 2017 01:16:31 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r453438 - head/Mk
Message-ID:  <201711040116.vA41GVPM058633@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans (src committer)
Date: Sat Nov  4 01:16:31 2017
New Revision: 453438
URL: https://svnweb.freebsd.org/changeset/ports/453438

Log:
  Mk/bsd.java.mk: Strict JAVA_{VERSION,VENDOR,ERROR} validation
  
  Currently, validation of JAVA_{VERSION,VENDOR,ERROR} does not constitute an
  error and make(1) will happily continue, potentially doing the wrong thing.
  Adjust the behavior as follows:
  
  - Only validate each var if it's defined
  - Remain verbose about what error exists and what's expected
  - Fail the build if validation fails
  
  bsd.java.mk exhibited this behavior up until r217132 inadvertently changed
  it to be non-fatal.
  
  PR:		220737
  Approved by:	portmgr (bdrewery)

Modified:
  head/Mk/bsd.java.mk

Modified: head/Mk/bsd.java.mk
==============================================================================
--- head/Mk/bsd.java.mk	Fri Nov  3 23:58:45 2017	(r453437)
+++ head/Mk/bsd.java.mk	Sat Nov  4 01:16:31 2017	(r453438)
@@ -216,33 +216,39 @@ check-makevars::
 .		endfor
 
 # Error checking: JAVA_VERSION
+.if defined(JAVA_VERSION)
 .if !defined(_JAVA_VERSION_LIST_REGEXP)
 _JAVA_VERSION_LIST_REGEXP=	${_JAVA_VERSION_LIST:C/\+/\\+/:ts|}
 .endif
 
 check-makevars::
-	@test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}" || \
-	(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE})) || true
+	@( test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}")) || \
+	(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE})
+.endif
 
 # Error checking: JAVA_VENDOR
+.if defined(JAVA_VENDOR)
 .if !defined(_JAVA_VENDOR_LIST_REGEXP)
 _JAVA_VENDOR_LIST_REGEXP=	${_JAVA_VENDOR_LIST:ts|}
 .endif
 
 check-makevars::
-	@test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" || \
+	@( test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" )) || \
 	(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}"; \
-	${FALSE})) || true
+	${FALSE})
+.endif
 
 # Error checking: JAVA_OS
+.if defined(JAVA_OS)
 .if !defined(_JAVA_OS_LIST_REGEXP)
 _JAVA_OS_LIST_REGEXP=	${_JAVA_OS_LIST:ts|}
 .endif
 
 check-makevars::
-	@test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}" || \
+	@( test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}")) || \
 	(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}"; \
-	${FALSE})) || true
+	${FALSE})
+.endif
 
 # Set default values for JAVA_BUILD and JAVA_RUN
 # When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre



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