aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorkevans <kevans@FreeBSD.org>2017-07-15 02:09:11 +0800
committerkevans <kevans@FreeBSD.org>2017-07-15 02:09:11 +0800
commit5ddeba9ebbee914faba5d2b27a426be9351ea314 (patch)
tree63d12bcf73511ae09dc59203de4512fbeac10a15 /Mk
parent7b60bd01a47b3dd53cb43a6c22030c24a60e4fd2 (diff)
downloadfreebsd-ports-gnome-5ddeba9ebbee914faba5d2b27a426be9351ea314.tar.gz
freebsd-ports-gnome-5ddeba9ebbee914faba5d2b27a426be9351ea314.tar.zst
freebsd-ports-gnome-5ddeba9ebbee914faba5d2b27a426be9351ea314.zip
Minor cleanup to Java version/vendor/OS validation
- Use POSIX compliant expressions instead of employing GNU extensions (branching in BREs) - Simplify regex generation using make(1)'s :ts modifier PR: 220054 Approved by: bapt (portmgr)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.java.mk30
1 files changed, 8 insertions, 22 deletions
diff --git a/Mk/bsd.java.mk b/Mk/bsd.java.mk
index d28596f069af..f6c2c36f3a34 100644
--- a/Mk/bsd.java.mk
+++ b/Mk/bsd.java.mk
@@ -214,44 +214,30 @@ check-makevars::
# Error checking: JAVA_VERSION
.if !defined(_JAVA_VERSION_LIST_REGEXP)
-. for v in ${_JAVA_VERSION_LIST}
-. if defined(_JAVA_VERSION_LIST_REGEXP)
-_JAVA_VERSION_LIST_REGEXP:= ${_JAVA_VERSION_LIST_REGEXP}\|
-. endif
-_JAVA_VERSION_LIST_REGEXP:= ${_JAVA_VERSION_LIST_REGEXP}$v
-. endfor
+_JAVA_VERSION_LIST_REGEXP= ${_JAVA_VERSION_LIST:C/\+/\\+/:ts|}
.endif
-
check-makevars::
- @test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -q "${_JAVA_VERSION_LIST_REGEXP}" || \
+ @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
# Error checking: JAVA_VENDOR
.if !defined(_JAVA_VENDOR_LIST_REGEXP)
-. for v in ${_JAVA_VENDOR_LIST}
-. if defined(_JAVA_VENDOR_LIST_REGEXP)
-_JAVA_VENDOR_LIST_REGEXP:= ${_JAVA_VENDOR_LIST_REGEXP}\|
-. endif
-_JAVA_VENDOR_LIST_REGEXP:= ${_JAVA_VENDOR_LIST_REGEXP}$v
-. endfor
+_JAVA_VENDOR_LIST_REGEXP= ${_JAVA_VENDOR_LIST:ts|}
.endif
+
check-makevars::
- @test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -q "${_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
# Error checking: JAVA_OS
.if !defined(_JAVA_OS_LIST_REGEXP)
-. for v in ${_JAVA_OS_LIST}
-. if defined(_JAVA_OS_LIST_REGEXP)
-_JAVA_OS_LIST_REGEXP:= ${_JAVA_OS_LIST_REGEXP}\|
-. endif
-_JAVA_OS_LIST_REGEXP:= ${_JAVA_OS_LIST_REGEXP}$v
-. endfor
+_JAVA_OS_LIST_REGEXP= ${_JAVA_OS_LIST:ts|}
.endif
+
check-makevars::
- @test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -q "${_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