fix_make_etags.patch
text/x-diff
Filename: fix_make_etags.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/tools/make_etags | 22 | 3 |
diff --git a/src/tools/make_etags b/src/tools/make_etags
index afc57e3e89..d0cfdb23d8 100755
--- a/src/tools/make_etags
+++ b/src/tools/make_etags
@@ -1,6 +1,25 @@
#!/bin/sh
# src/tools/make_etags
-cdir=`dirname $0`
-dir=`(cd $cdir && pwd)`
-exec $dir/make_ctags -e $*
+IS_EXUBERANT=""
+command -v ctags >/dev/null && \
+ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y"
+
+if [ "$IS_EXUBERANT" ]; then
+ cdir=`dirname $0`
+ dir=`(cd $cdir && pwd)`
+ exec $dir/make_ctags -e $*
+else
+ command -v etags >/dev/null || \
+ { echo "'etags' program not found" 1>&2; exit 1; }
+
+ rm -f ./TAGS
+
+ find `pwd`/ -type f -name '*.[chyl]' -print |
+ xargs etags --append -o TAGS
+
+ find . \( -name CVS -prune \) -o \( -name .git -prune \) -o -type d -print |
+ while read DIR
+ do [ "$DIR" != "." ] && ln -f -s `pwd`/TAGS "$DIR"
+ done
+fi