From nick@van-laarhoven.org  Fri Aug 22 21:02:27 2008
Return-Path: <nick@van-laarhoven.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B695106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 21:02:27 +0000 (UTC)
	(envelope-from nick@van-laarhoven.org)
Received: from hpsmtp-eml15.kpnxchange.com (hpsmtp-eml15.kpnxchange.com [213.75.38.115])
	by mx1.freebsd.org (Postfix) with ESMTP id B6AE38FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 21:02:26 +0000 (UTC)
	(envelope-from nick@van-laarhoven.org)
Received: from cpsmtpi-eml04.kpnxchange.com ([213.75.38.134]) by hpsmtp-eml15.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 22 Aug 2008 23:02:24 +0200
Received: from uitsmijter.van-laarhoven.org ([81.207.207.222]) by cpsmtpi-eml04.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 22 Aug 2008 23:02:24 +0200
Received: (qmail 94210 invoked by uid 98); 22 Aug 2008 21:02:21 -0000
Received: from 10.66.0.133 (nick@10.66.0.133) by uitsmijter.van-laarhoven.org (envelope-from <nick@van-laarhoven.org>, uid 82) with qmail-scanner-2.01 
 (clamdscan: 0.92/5270. f-prot: 4.6.7/3.16.15. spamassassin: 3.2.3.  
 Clear:RC:1(10.66.0.133):. 
 Processed in 0.754519 secs); 22 Aug 2008 21:02:21 -0000
Received: from unknown (HELO van-laarhoven.org) (nick@10.66.0.133)
  by uitsmijter.van-laarhoven.org with SMTP; 22 Aug 2008 21:02:20 -0000
Received: (nullmailer pid 5431 invoked by uid 1001);
	Fri, 22 Aug 2008 21:02:20 -0000
Message-Id: <1219438940.453155.5430.nullmailer@van-laarhoven.org>
Date: Fri, 22 Aug 2008 23:02:20 +0200
From: Nick Hibma <nick@anywi.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: bsd.dep.mk does not remove .depend on cleandepend if CTAGS is not set or set to something other than ctags or gtags.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         126747
>Category:       misc
>Synopsis:       [build] bsd.dep.mk does not remove .depend on cleandepend if CTAGS is not set or set to something other than ctags or gtags.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 22 21:10:02 UTC 2008
>Closed-Date:    Thu Jan 21 13:16:23 UTC 2010
>Last-Modified:  Thu Jan 21 13:20:05 UTC 2010
>Originator:     Nick Hibma
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD hind.van-laarhoven.org 7.0-STABLE FreeBSD 7.0-STABLE #3: Thu Aug 14 21:10:55 CEST 2008 toor@hind.van-laarhoven.org:/usr/src/sys/i386/compile/HIND i386


>Description:
	cleandepend in /usr/share/mk/bsd.dep.mk depends on the CTAGS variable in a strange way.
	It does not remove the .depend file unless CTAGS is set to a value it understands.
>How-To-Repeat:

	make CTAGS=exctags depend
	make CTAGS=exctags cleandepend
	make CTAGS=exctags depend

Notice how the second time round the depend does not execute any commands.

>Fix:
Change in /usr/share/mk/bsd.dep.mk

	.if !target(cleandepend)
	cleandepend:
	.if defined(SRCS)
	.if ${CTAGS:T} == "ctags"
		rm -f ${DEPENDFILE} tags
	.elif ${CTAGS:T} == "gtags"
		rm -f ${DEPENDFILE} GPATH GRTAGS GSYMS GTAGS
	.if defined(HTML)
		rm -rf HTML
	.endif
	.endif
	.endif
	.endif

to

	.if !target(cleandepend)
	cleandepend:
	.if defined(SRCS)
	.if ${CTAGS:T} == "gtags"
		rm -f ${DEPENDFILE} GPATH GRTAGS GSYMS GTAGS
	.if defined(HTML)
		rm -rf HTML
	.endif
	.else
		rm -f ${DEPENDFILE} tags
	.endif
	.endif
	.endif

which deletes .depend and the tags file in all cases.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Mon Jan 18 15:42:09 UTC 2010 
Responsible-Changed-Why:  
I'll handle MFC. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/126747: commit references a PR
Date: Mon, 18 Jan 2010 15:42:09 +0000 (UTC)

 Author: ru
 Date: Mon Jan 18 15:41:55 2010
 New Revision: 202578
 URL: http://svn.freebsd.org/changeset/base/202578
 
 Log:
   If CTAGS is not set or set to something other than "ctags" or "gtags",
   "cleandepend" was not removing the .depend file; fixed.
   
   PR:		126747
   MFC after:	3 days
 
 Modified:
   head/share/mk/bsd.dep.mk
 
 Modified: head/share/mk/bsd.dep.mk
 ==============================================================================
 --- head/share/mk/bsd.dep.mk	Mon Jan 18 14:51:00 2010	(r202577)
 +++ head/share/mk/bsd.dep.mk	Mon Jan 18 15:41:55 2010	(r202578)
 @@ -182,6 +182,8 @@ cleandepend:
  .if defined(HTML)
  	rm -rf HTML
  .endif
 +.else
 +	rm -f ${DEPENDFILE}
  .endif
  .endif
  .endif
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Thu Jan 21 13:15:39 UTC 2010 
State-Changed-Why:  
Fixed in 8.0-STABLE. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/126747: commit references a PR
Date: Thu, 21 Jan 2010 13:15:33 +0000 (UTC)

 Author: ru
 Date: Thu Jan 21 13:15:14 2010
 New Revision: 202747
 URL: http://svn.freebsd.org/changeset/base/202747
 
 Log:
   MFC r202578 and r202579:
   
   If CTAGS is not set or set to something other than "ctags" or "gtags",
   "cleandepend" was not removing the .depend file; fixed. [1]
   
   Allow the CTAGS to be set to something other than "gtags" or "ctags",
   but assume it supports a ctags(1)-compatible syntax. [2]
   
   PR:		126747 [1], 46676 [2]
 
 Modified:
   stable/8/share/mk/bsd.dep.mk
 Directory Properties:
   stable/8/share/mk/   (props changed)
 
 Modified: stable/8/share/mk/bsd.dep.mk
 ==============================================================================
 --- stable/8/share/mk/bsd.dep.mk	Thu Jan 21 13:00:28 2010	(r202746)
 +++ stable/8/share/mk/bsd.dep.mk	Thu Jan 21 13:15:14 2010	(r202747)
 @@ -58,14 +58,14 @@ DEPENDFILE?=	.depend
  # Keep `tags' here, before SRCS are mangled below for `depend'.
  .if !target(tags) && defined(SRCS) && !defined(NO_TAGS)
  tags: ${SRCS}
 -.if ${CTAGS:T} == "ctags"
 -	@${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
 -	    ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
 -.elif ${CTAGS:T} == "gtags"
 +.if ${CTAGS:T} == "gtags"
  	@cd ${.CURDIR} && ${CTAGS} ${GTAGSFLAGS} ${.OBJDIR}
  .if defined(HTML)
  	@cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR}
  .endif
 +.else
 +	@${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
 +	    ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
  .endif
  .endif
  
 @@ -175,13 +175,13 @@ afterdepend:
  .if !target(cleandepend)
  cleandepend:
  .if defined(SRCS)
 -.if ${CTAGS:T} == "ctags"
 -	rm -f ${DEPENDFILE} tags
 -.elif ${CTAGS:T} == "gtags"
 +.if ${CTAGS:T} == "gtags"
  	rm -f ${DEPENDFILE} GPATH GRTAGS GSYMS GTAGS
  .if defined(HTML)
  	rm -rf HTML
  .endif
 +.else
 +	rm -f ${DEPENDFILE} tags
  .endif
  .endif
  .endif
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
