From lyndon@orthanc.ab.ca  Wed Jan  1 14:31:14 2003
Return-Path: <lyndon@orthanc.ab.ca>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1DE4B37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2003 14:31:14 -0800 (PST)
Received: from orthanc.ab.ca (114.216-123-230-0.interbaun.com [216.123.230.114])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 757D343EC5
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2003 14:31:13 -0800 (PST)
	(envelope-from lyndon@orthanc.ab.ca)
Received: from orthanc.ab.ca (localhost6 [IPv6:::1])
	by orthanc.ab.ca (8.12.6/8.12.6) with ESMTP id h01MVC1q032797
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 Jan 2003 15:31:12 -0700 (MST)
	(envelope-from lyndon@orthanc.ab.ca)
Received: (from lyndon@localhost)
	by orthanc.ab.ca (8.12.6/8.12.6/Submit) id h01MVCna032796;
	Wed, 1 Jan 2003 15:31:12 -0700 (MST)
Message-Id: <200301012231.h01MVCna032796@orthanc.ab.ca>
Date: Wed, 1 Jan 2003 15:31:12 -0700 (MST)
From: Lyndon Nerenberg <lyndon@orthanc.ab.ca>
Reply-To: Lyndon Nerenberg <lyndon@orthanc.ab.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] bsd.dep.mk restricts domain of tags commands
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46676
>Category:       bin
>Synopsis:       [patch] [build] bsd.dep.mk restricts domain of tags commands
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 01 14:40:01 PST 2003
>Closed-Date:    Thu Jan 21 13:16:38 UTC 2010
>Last-Modified:  Thu Jan 21 13:20:07 UTC 2010
>Originator:     Lyndon Nerenberg
>Release:        current
>Organization:
>Environment:
System: FreeBSD foo 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Wed Dec  4 11:49:07 MST 2002     root@foo:/u/freebsd/cvssrc/RELENG_4/sys/i386/compile/DL  i386
>Description:
	The tags target in bsd.dep.mk only allows ctags and gtags as
	tag generator commands.
>How-To-Repeat:
	Set CTAGS=etags in /etc/make.conf, then run make tags.
>Fix:
	The bsd.dep.mk rules have some intimate knowledge of the
	command line invocations of ctags and gtags. Setting the
	flags is done by comparing the CTAGS value to the fixed strings
	"ctags" and "gtags" with no default case. Thus, assigning any
	other value to CTAGS turns the tags target into a no-op.

	The attached patch removes the explicit ctags case, and instead
	makes that the default recipe unless CTAGS is set to gtags.
	The ctags-style invocation is generic enough that it should
	adapt to most other tags generators. It's not unreasonable to
	require the replacement tags command to support the -f switch.


--- /usr/src/share/mk/bsd.dep.mk	Thu Nov 28 15:19:38 2002
+++ bsd.dep.mk	Wed Jan  1 15:16:02 2003
@@ -56,14 +56,14 @@
 # Keep `tags' here, before SRCS are mangled below for `depend'.
 .if !target(tags) && defined(SRCS) && !defined(NOTAGS)
 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
>Release-Note:
>Audit-Trail:

From: Lyndon Nerenberg {VE6BBM} <lyndon@orthanc.ab.ca>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/46676: [PATCH] bsd.dep.mk restricts domain of tags commands 
Date: Wed, 01 Jan 2003 16:52:28 -0700

 Sorry folks, the second half of the patch got chopped. Here it is again.
 
 Index: bsd.dep.mk
 ===================================================================
 RCS file: /home/ncvs/src/share/mk/bsd.dep.mk,v
 retrieving revision 1.38
 diff -u -r1.38 bsd.dep.mk
 --- bsd.dep.mk	2002/10/17 13:48:13	1.38
 +++ bsd.dep.mk	2003/01/01 23:50:42
 @@ -56,14 +56,14 @@
  # Keep `tags' here, before SRCS are mangled below for `depend'.
  .if !target(tags) && defined(SRCS) && !defined(NOTAGS)
  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
  
 @@ -160,13 +160,13 @@
  .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
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Feb 23 13:57:16 PST 2003 
Responsible-Changed-Why:  
Over to share/mk guru. 

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

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

 Author: ru
 Date: Mon Jan 18 15:58:02 2010
 New Revision: 202579
 URL: http://svn.freebsd.org/changeset/base/202579
 
 Log:
   Allow the CTAGS to be set to something other than "gtags" or "ctags",
   but assume it supports a ctags(1)-compatible syntax.
   
   PR:		46676
   Submitted by:	Lyndon Nerenberg
   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 15:41:55 2010	(r202578)
 +++ head/share/mk/bsd.dep.mk	Mon Jan 18 15:58:02 2010	(r202579)
 @@ -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,15 +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}
 +	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"
 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Thu Jan 21 13:16:24 UTC 2010 
State-Changed-Why:  
Fixed in 8.0-STABLE. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/46676: commit references a PR
Date: Thu, 21 Jan 2010 13:15:34 +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:
