Remove non-free old and crusty clearcase pkg
[packages] / xemacs-packages / semantic / semanticdb.sh
1 #!/bin/sh
2 # semanticdb.sh --- Build a semantic cache for input arguments
3 #
4 # Copyright (C) 2002, 2004 Eric M. Ludlam
5 #
6 # Author: Eric M. Ludlam <zappo@gnu.org>
7 # Keywords: tags
8 # X-RCS: $Id: semanticdb.sh,v 1.1 2007-11-26 15:10:48 michaels Exp $
9 #
10 # This file is not part of GNU Emacs.
11 #
12 # Semanticdb is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2, or (at your option)
15 # any later version.
16 #
17 # This software is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with GNU Emacs; see the file COPYING.  If not, write to the
24 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 # Boston, MA 02110-1301, USA.
26
27 # Commentary:
28 #
29 # Emacs usually builds a semantic cache on the fly.  If you want to use
30 # a tool that accesses database files without having to visit all the files, 
31 # however, you should use this script BEFORE starting Emacs.
32 #
33
34 if [ -z "$SEMANTIC_PATH" ]; then
35     # Use reverse sort to sneakilly get the most recent version number.
36     shopt -s nullglob
37     # The extra * allow the shell to strip out junk
38     files=`ls -d ~/lisp/cedet/semantic*/ ~/lisp/cedet-*/semantic/ ~/cedet/semantic*/ ~/cedet-*/semantic/`
39     for i in $files; do
40         if [ -d $i ]; then
41           loadpath=$i
42         fi
43     done
44 else
45     loadpath="$SEMANTIC_PATH"
46 fi
47
48 if [ -z "$SEMANTIC_EMACS" ]; then
49     emacs="emacs"
50 else
51     emacs="$SEMANTIC_EMACS"
52 fi
53
54 files=$*
55
56 exec $emacs -batch -l "${loadpath}/semanticdb-mk.el" $files
57
58 #end