From owner-freebsd-bugs Wed Jan 1 14:40: 5 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B65237B401 for ; Wed, 1 Jan 2003 14:40:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5EF2943EC5 for ; Wed, 1 Jan 2003 14:40:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h01Me2NS086985 for ; Wed, 1 Jan 2003 14:40:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h01Me2nt086984; Wed, 1 Jan 2003 14:40:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DE4B37B401 for ; 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 ; 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 ; 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 Reply-To: Lyndon Nerenberg To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/46676: [PATCH] bsd.dep.mk restricts domain of tags commands Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46676 >Category: bin >Synopsis: [PATCH] bsd.dep.mk restricts domain of tags commands >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 01 14:40:01 PST 2003 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message