From: Horms Subject: Re: [RFC] build: use xargs in conjunction with etags Date: Tue, 27 Jun 2006 10:53:03 +0900 Message-ID: <20060627015303.GA2269@tabatha.lab.ultramonkey.org> References: <20060623083241.GA9323@verge.net.au> <87bqsjq5sm.fsf@pike.pond.sub.org> <20060624062236.GA19117@verge.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20060624062236.GA19117@verge.net.au> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Markus Armbruster List-Id: xen-devel@lists.xenproject.org On Sat, Jun 24, 2006 at 03:22:36PM +0900, Horms wrote: > On Fri, Jun 23, 2006 at 04:56:41PM +0200, Markus Armbruster wrote: > > Horms writes: > > > > > The existing etags invocation does not seem to work for me, > > > but using xargs in the same way that it is used for crats does. > > > I'm pretty sure that is because on Debian etags == ctags, > > > does anyone have etags lying around to test if this works? > > > > > > Also, I'm pretty sure this xargs approach will break for both ctags > > > and etags if there are too many files to for one command line, > > > as ctags/etags will be invoked multiple times, and the resulting > > > tags file will only contain the tags for the last invocation. > > > > > > Signed-Off-By: Horms > > > --- x/xen/Makefile > > > +++ x/xen/Makefile > > > @@ -132,7 +136,7 @@ endef > > > > > > .PHONY: _TAGS > > > _TAGS: > > > - $(all_sources) | etags - > > > + $(all_sources) | xargs etags > > > > When xargs invokes etags more than once (i.e. it's actually needed), > > each invocation will clobber the output of the previous one. > > Indeed, I was concerned about that. > > > To run > > etags on an arbitrarily long file list, try something like > > > > rm -f TAGS && $(all_sources) | xargs etags -a > > Is the rm -f TAGS neccessary? On further investigation I see that the answer is yes as -a is append. > I believe that for ctags the following will work. At least it seems > to work just fine here with exuberant-ctags 5.5.4 > > $(all_sources) | xargs ctags -L - The above line should not include xargs $(all_sources) | ctags -L - But it turns out that ctags can use the same syntax as ctags rm -f tags && $(all_sources) | xargs ctags -a I will send a patch that has ctags and etags use -a, I believe this will also work on Debian where ctags is the etags binary (I tested it and it seems fine, as when invoked as etags the code produces a TAGS file, and when invoked as ctags it produces a tags file). -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/