[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] Efficiently find out if <file> is source or not
From: |
Cameron Patrick |
Subject: |
Re: [Gnu-arch-users] Efficiently find out if <file> is source or not |
Date: |
Sun, 14 Mar 2004 12:38:12 +0800 |
User-agent: |
Mutt/1.5.5.1+cvs20040105+cjp-1i |
Stefan Monnier wrote:
| How can I do that efficiently [ i.e. in constant time ] ?
| Ideally this should work even if tla is not installed.
You would need to (a) parse {arch}=tagging-method; (b) make sure it
matches the source regexp and not the unrecognised one; (c) depending
on the tagging method, look for an arch-tag: in the file, or a
.arch-ids/$FILENAME.id, or whatever.
A quick and nasty method would be to do only the last check, I
suppose.
| The only way I could come up with is to do something akin to:
|
| tla inventory -s `dirname $file` | grep $file
|
| but this can take a long time.
It's guaranteed to work the same way as tla does though :-)
Cameron.