From nobody@FreeBSD.org  Sat Jan  9 17:25:53 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35B08106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Jan 2010 17:25:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A5228FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Jan 2010 17:25:53 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o09HPqZe068616
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 9 Jan 2010 17:25:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o09HPqCG068597;
	Sat, 9 Jan 2010 17:25:52 GMT
	(envelope-from nobody)
Message-Id: <201001091725.o09HPqCG068597@www.freebsd.org>
Date: Sat, 9 Jan 2010 17:25:52 GMT
From: Scot Hetzel <swhetzel@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] make delete-old removes BIND files when the BIND port is installed using WITH_REPLACE_BASE
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142529
>Category:       bin
>Synopsis:       [build] [patch] make delete-old removes BIND files when the BIND port is installed using WITH_REPLACE_BASE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 09 17:30:04 UTC 2010
>Closed-Date:    Thu Dec 23 21:26:35 UTC 2010
>Last-Modified:  Thu Dec 23 21:26:35 UTC 2010
>Originator:     Scot Hetzel
>Release:        8.0-Stable
>Organization:
>Environment:
FreeBSD dv8t01 8.0-STABLE FreeBSD 8.0-STABLE #10 r201599M: Tue Jan  5 14:29:56 CST 2010     swhetzel@dv8t01:/usr/obj/usr/src/8-stable/sys/GENERIC  amd64

>Description:
When the BIND ports are installed using the WITH_REPLACE_BASE option,
they overwrite bind installed by the FreeBSD sources.  Then when 'make
delete-old' is used, it removes the files installed by the BIND ports
>How-To-Repeat:
echo "WITH_REPLACE_BASE" > /etc/make.conf
cd /usr/ports/dns/bind9
make install
cd /usr/src
make delete-old

The files installed by the BIND port are now removed.
>Fix:
The attached patch fixes this problem by only allowing to delete the BIND files when WITH_REPLACE_BASE or WITH_REPLACE_BASE_BIND are not defined.

Patch attached with submission follows:

Index: tools/build/mk/OptionalObsoleteFiles.inc
===================================================================
--- tools/build/mk/OptionalObsoleteFiles.inc	(revision 201599)
+++ tools/build/mk/OptionalObsoleteFiles.inc	(working copy)
@@ -35,6 +35,7 @@
 # to be filled in
 #.endif
 
+.if ${MK_REPLACE_BASE_BIND} == no 
 .if ${MK_BIND} == no
 OLD_FILES+=usr/bin/dig
 OLD_FILES+=usr/bin/host
@@ -231,6 +232,7 @@
 #.if ${MK_BIND_NAMED} == no || ${MK_BIND} == no
 # to be filled in and removed above
 #.endif
+.endif
 
 .if ${MK_BLUETOOTH} == no
 OLD_FILES+=usr/bin/bthost
Index: share/mk/bsd.own.mk
===================================================================
--- share/mk/bsd.own.mk	(revision 201599)
+++ share/mk/bsd.own.mk	(working copy)
@@ -409,7 +409,8 @@
     BIND_XML \
     GNU_CPIO \
     HESIOD \
-    IDEA
+    IDEA \
+    REPLACE_BASE_BIND
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
@@ -435,6 +436,14 @@
 MK_BIND:=	no
 .endif
 
+.if defined(WITH_REPLACE_BASE)
+MK_REPLACE_BASE_BIND:=	yes
+.endif
+
+.if ${MK_REPLACE_BASE_BIND} == "yes"
+MK_BIND:=	no
+.endif
+
 .if ${MK_BIND} == "no"
 MK_BIND_DNSSEC:= no
 MK_BIND_ETC:=	no


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jan 10 01:18:06 UTC 2010 
Responsible-Changed-Why:  
This is probably Doug's domain. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142529 
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Mon May 17 00:37:42 UTC 2010 
State-Changed-Why:  

I'm sort of inclined to put this in the "Doctor, it hurts when I do _this_" 
category. I'm also not sure your proposed solution would work, since a lot 
of people use things like ports-mgmt/portconf to isolate their ports options 
from the base, and this solution would not work with that (unless of course 
the person were to put REPLACE_BASE_BIND in their make.conf).  


http://www.freebsd.org/cgi/query-pr.cgi?pr=142529 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Thu Dec 23 21:25:52 UTC 2010 
State-Changed-Why:  

I've given this more thought, and I still don't like the 
proposed solution, sorry. In any case, thanks for your 
interest in making FreeBSD better. 


Doug 

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