From rv@arabica.esil.univ-mrs.fr  Wed Jun 30 14:53:22 2004
Return-Path: <rv@arabica.esil.univ-mrs.fr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 7EA3E16A4CE; Wed, 30 Jun 2004 14:53:22 +0000 (GMT)
Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id D421343D1F; Wed, 30 Jun 2004 14:53:21 +0000 (GMT)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: from arabica.esil.univ-mrs.fr (localhost.esil.univ-mrs.fr [127.0.0.1])
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10) with ESMTP id i5UEqX2r091786;
	Wed, 30 Jun 2004 16:52:33 +0200 (CEST)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: (from rv@localhost)
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10/Submit) id i5UEqWb7091785;
	Wed, 30 Jun 2004 16:52:32 +0200 (CEST)
	(envelope-from rv)
Message-Id: <200406301452.i5UEqWb7091785@arabica.esil.univ-mrs.fr>
Date: Wed, 30 Jun 2004 16:52:32 +0200 (CEST)
From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc: glewis@freebsd.org, linimon@freebsd.org, znerd@freebsd.org
Subject: [PATCH] bsd.kava.mk: re-apply previous PR improvements
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         68516
>Category:       java
>Synopsis:       [PATCH] bsd.java.mk: re-apply previous PR improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glewis
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 30 15:00:36 GMT 2004
>Closed-Date:    Thu Jul 01 22:44:27 GMT 2004
>Last-Modified:  Thu Jul 01 22:44:27 GMT 2004
>Originator:     Herve Quiroz
>Release:        FreeBSD 5.2.1-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD arabica.esil.univ-mrs.fr 5.2.1-RELEASE-p5 i386

>Description:

Mark Linimon sent a PR[1] regarding improvement to the ports system that has
been commited during January. Unfortunately, we then commited version 2.0 of
bsd.java.mk which was based on an earlier snapshot and thus we did override the
changes.

This patch implements the feature proposed by Mark for the latest version of
bsd.java.mk.

Ironically, I realized by doing this patch that the original patch from Mark
seemed to be broken regarding bsd.java.mk (a typo: "check-makevers" ->
"check-makevars"). This issue is only related to bsd.java.mk so AFAICT the
remaining of the original patch is fine.

To test the patch:

$ cd /usr/ports/java/trove4j && make -DJAVA_BUILD
trove4j-1.1b3: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time.
*** Error code 1

Stop in /usr/ports/java/trove4j.

$ cd /usr/ports && make java/trove4j -DJAVA_BUILD
`java/trove4j' is up to date.


[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=61351

* Ernst de Haan is cc'd as he is the maintainer of bsd.java.mk
* Greg Lewis is cc'd as he is the commiter of the most recent changes to
bsd.java.mk
* Mark Linimon is cc'd as he is the originator of the initial PR

>How-To-Repeat:

>Fix:

--- bsd.java.mk.original	Wed Jun 30 16:04:40 2004
+++ bsd.java.mk	Wed Jun 30 16:13:27 2004
@@ -231,14 +231,14 @@
 .			if !defined(JAVA_VERSION)
 JAVA_VERSION=	${USE_JAVA}
 .			else
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: The port is using bsd.java.mk 1.0 but sets a value for JAVA_VERSION. This may cause problems."
+check-makevars::
+	@${ECHO_CMD} "${PKGNAME}: Makefile error: The port is using bsd.java.mk 1.0 but sets a value for JAVA_VERSION. This may cause problems."
 	@${FALSE}
 .			endif
 # NO_{BUILD|RUN}_DEPENDS_JAVA --> JAVA_{BUILD|RUN}
 .			if defined(NO_BUILD_DEPENDS_JAVA) && defined(NO_RUN_DEPENDS_JAVA)
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: NO_BUILD_DEPENDS_JAVA and NO_RUN_DEPENDS_JAVA cannot be set at the same time.";
+check-makevars::
+	@${ECHO_CMD} "${PKGNAME}: Makefile error: NO_BUILD_DEPENDS_JAVA and NO_RUN_DEPENDS_JAVA cannot be set at the same time.";
 	@${FALSE}
 .			else
 .				if !defined(NO_BUILD_DEPENDS_JAVA) && !defined(NO_BUILD)
@@ -255,8 +255,8 @@
 .				elif (${NEED_JAVAC} == "NO") || (${NEED_JAVAC} == "no")
 JAVA_BUILD=		jre
 .				else
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: \"${NEED_JAVAC}\" is not a valid value for NEED_JAVAC. It should be YES or NO, or it should be undefined.";
+check-makevars::
+	@${ECHO_CMD} "${PKGNAME}: Makefile error: \"${NEED_JAVAC}\" is not a valid value for NEED_JAVAC. It should be YES or NO, or it should be undefined.";
 	@${FALSE}
 .				endif
 .			endif
@@ -275,8 +275,8 @@
 _ERROR_CHECKING_JAVA_VERSION!=	${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" \
 								| ${GREP} -v "${_JAVA_VERSION_LIST_REGEXP}" || true
 .		if (${_ERROR_CHECKING_JAVA_VERSION} != "")
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)";
+check-makevars::
+	@${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
 
@@ -285,8 +285,8 @@
 _ERROR_CHECKING_JAVA_VENDOR!=	${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" \
 								| ${GREP} -v "${_JAVA_VENDOR_LIST_REGEXP}" || true
 .		if (${_ERROR_CHECKING_JAVA_VENDOR} != "")
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}";
+check-makevars::
+	@${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}
 .		endif
 
@@ -295,8 +295,8 @@
 _ERROR_CHECKING_JAVA_OS!=	${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" \
 							| ${GREP} -v "${_JAVA_OS_LIST_REGEXP}" || true
 .		if (${_ERROR_CHECKING_JAVA_OS} != "")
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}";
+check-makevars::
+	@${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}
 .		endif
 
@@ -394,8 +394,8 @@
 .			endif
 .		if defined(JAVA_BUILD)
 .			if defined(NO_BUILD)
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
+check-makevars::
+	@${ECHO_CMD} "${PKGNAME}: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
 	@${FALSE}
 .				endif
 BUILD_DEPENDS+=		${DEPEND_JAVA}
@@ -425,8 +425,8 @@
 JAVAC?=		${_JIKES_PATH} -bootclasspath ${JAVA_CLASSES}
 BUILD_DEPENDS+=	${DEPEND_JIKES}
 .			elif !((${USE_JIKES} == "NO") || (${USE_JIKES} == "no"))
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: \"${USE_JIKES}\" is not a valid value for USE_JIKES. It should be YES or NO, or it should be undefined.";
+check-makevars::
+	@${ECHO_CMD} "${PKGNAME}: Makefile error: \"${USE_JIKES}\" is not a valid value for USE_JIKES. It should be YES or NO, or it should be undefined.";
 	@${FALSE}
 .			endif
 .		endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-java->glewis 
Responsible-Changed-By: glewis 
Responsible-Changed-When: Wed Jun 30 15:02:13 GMT 2004 
Responsible-Changed-Why:  
I'll take this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68516 

From: Mark Linimon <linimon@lonesome.com>
To: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
Cc: FreeBSD-gnats-submit@FreeBSD.org, <glewis@FreeBSD.org>,
	<znerd@FreeBSD.org>, <linimon@FreeBSD.org>,
	<freebsd-java@FreeBSD.org>
Subject: Re: java/68516: [PATCH] bsd.kava.mk: re-apply previous PR improvements
Date: Wed, 30 Jun 2004 12:31:29 -0500 (CDT)

 On Wed, 30 Jun 2004, Herve Quiroz wrote:
 
 > Ironically, I realized by doing this patch that the original patch from Mark
 > seemed to be broken regarding bsd.java.mk (a typo: "check-makevers" ->
 > "check-makevars").
 
 Yep, just a typo.  I vaguely remember doing some regression testing
 with setting up bogus user environments and trying to exercise each
 code path, but I must have missed that one.
 
 For those that don't understand the impact of the changes, they are
 designed to allow 'make index' and 'make search' to succeed despite
 any bogus user environment.  The use of .BEGIN or .error directives
 in Makefiles introduces such fragility; they should only be used in
 cases to indicate that the ports infrastructure itself is broken
 (has had a bad commit to the master repository), rather than that
 there is some invalid setup on an individual machine.
 
 And yes, I know that we have a number of these scattered around.
 They all need to be fixed.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: glewis 
State-Changed-When: Thu Jul 1 22:44:17 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68516 
>Unformatted:
