From leeym@utopia.leeym.com  Sat Jul 24 02:45:55 2004
Return-Path: <leeym@utopia.leeym.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 58A7D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Jul 2004 02:45:55 +0000 (GMT)
Received: from utopia.leeym.com (utopia.leeym.com [211.21.137.52])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0D83E43D48
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Jul 2004 02:45:55 +0000 (GMT)
	(envelope-from leeym@utopia.leeym.com)
Received: from localhost (localhost [127.0.0.1])
	by utopia.leeym.com (Postfix) with ESMTP id C39813EA93A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Jul 2004 10:45:53 +0800 (CST)
Received: from utopia.leeym.com ([127.0.0.1])
 by localhost (utopia.leeym.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 83152-02 for <FreeBSD-gnats-submit@freebsd.org>;
 Sat, 24 Jul 2004 10:45:51 +0800 (CST)
Received: by utopia.leeym.com (Postfix, from userid 1000)
	id 1EE6D3EA936; Sat, 24 Jul 2004 10:45:51 +0800 (CST)
Message-Id: <20040724024551.1EE6D3EA936@utopia.leeym.com>
Date: Sat, 24 Jul 2004 10:45:51 +0800 (CST)
From: Yen-Ming Lee <leeym@utopia.leeym.com>
Reply-To: Yen-Ming Lee <leeym@utopia.leeym.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: OPTIONS and NO_(CHECKSUM|BUILD|INSTALL|PACKAGE)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         69512
>Category:       ports
>Synopsis:       OPTIONS and NO_(CHECKSUM|BUILD|INSTALL|PACKAGE)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 24 02:50:16 GMT 2004
>Closed-Date:    Thu Jun 09 20:48:57 GMT 2005
>Last-Modified:  Thu Jun 09 20:48:57 GMT 2005
>Originator:     Yen-Ming Lee
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD utopia.leeym.com 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #143: Tue Jul 6 05:16:06 CST 2004 root@utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386


	
>Description:

If a port has OPTIONS and NO_(CHECKSUM|BUILD|INSTALL|PACKAGE) in its Makefile,
the NO_(CHECKSUM|BUILD|INSTALL|PACKAGE) will be ignored when !_OPTIONS_OK.

This problem occurs when I was trying to apply OPTIONS in mail/openwebmail,
which has NO_BUILD already. The port entered the build target and showed:

===>  Building for openwebmail-2.32
make: cannot open Makefile.
*** Error code 2

However, since it has NO_BUILD, it shouldn't do build at all.

>How-To-Repeat:

Let's make a simpler sample.

- put NO_CHECKSUM in lang/php4/Makefile
- cd /usr/ports/lang/php4 && make rmcofig clean
- cd /usr/ports/lang/php4 && make checksum
- and php4 port will ignore NO_CHECKSUM and do checksum.

>Fix:

Remove defined(_OPTIONS_OK) when disabling targets.

--- bsd.port.mk.diff begins here ---
--- /home/leeym/cvs/ports/Mk/bsd.port.mk	Sat Jul 24 10:17:10 2004
+++ /usr/ports/Mk/bsd.port.mk	Sat Jul 24 10:24:42 2004
@@ -2738,25 +2738,25 @@
 ################################################################
 
 # Disable checksum
-.if defined(NO_CHECKSUM) && !target(checksum) && defined(_OPTIONS_OK)
+.if defined(NO_CHECKSUM) && !target(checksum)
 checksum: fetch
 	@${DO_NADA}
 .endif
 
 # Disable build
-.if defined(NO_BUILD) && !target(build) && defined(_OPTIONS_OK)
+.if defined(NO_BUILD) && !target(build)
 build: configure
 	@${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
 .endif
 
 # Disable install
-.if defined(NO_INSTALL) && !target(install) && defined(_OPTIONS_OK)
+.if defined(NO_INSTALL) && !target(install)
 install: build
 	@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
 .endif
 
 # Disable package
-.if defined(NO_PACKAGE) && !target(package) && defined(_OPTIONS_OK)
+.if defined(NO_PACKAGE) && !target(package)
 package:
 .if defined(IGNORE_SILENT)
 	@${DO_NADA}
--- bsd.port.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: sem 
Responsible-Changed-When: Sat Jul 24 06:12:53 GMT 2004 
Responsible-Changed-Why:  
portmgr territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69512 
State-Changed-From-To: open->analyzed 
State-Changed-By: kris 
State-Changed-When: Wed Jun 1 19:42:52 GMT 2005 
State-Changed-Why:  
Currently scheduled for testing on the next experimental package build. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69512 
State-Changed-From-To: analyzed->closed 
State-Changed-By: krion 
State-Changed-When: Thu Jun 9 20:48:51 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

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