WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [RFC] build: use xargs in conjunction with etags

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [RFC] build: use xargs in conjunction with etags
From: Horms <horms@xxxxxxxxxxxx>
Date: Tue, 27 Jun 2006 11:02:55 +0900 (JST)
Cc: Markus Armbruster <armbru@xxxxxxxxxx>
Delivery-date: Tue, 27 Jun 2006 02:53:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060624062236.GA19117@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (Linux/2.6.16-2-686 (i686))
[ Sorry if this is a duplicate, I had a problem with my mail client
  and I'm not sure where the previous incarntation went ]

In article <20060624062236.GA19117@xxxxxxxxxxxx> you wrote:
> On Fri, Jun 23, 2006 at 04:56:41PM +0200, Markus Armbruster wrote:
>> Horms <horms@xxxxxxxxxxxx> 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 <horms@xxxxxxxxxxxx>
>> > --- 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 research I see that -a means append, so yes the rm is
neccessary.

> 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 -

For the record, xargs should not be present in the above command line

        $(all_sources) | ctags -L -

However, the same syntax as etags can also be used, which is nice for
uniformity

        rm -f tags && $(all_sources) | xargs ctags -a

I will post a patch that uses the -a approach for both etags and ctags.
This should work for pretty much all systems. In particular I tested
debian, where ctags and etags are the same binary, and this approach
works because a TAGS file is produced when the binary is invoked as
etags, and a tags file is produced when the binary is invoked as etags.

-- 
Horms                                           
H: http://www.vergenet.net/~horms/          W: http://www.valinux.co.jp/en/


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel