annotate lib-src/update-custom.sh @ 5542:dab422055bab

Correct array bound for syntax_code_spec.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 08 Aug 2011 13:57:20 +0900
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 #!/bin/sh
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 ### update-custom.sh --- update Customize group dependencies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 # Author: Hrvoje Niksic, based on update-autoloads.el by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 # Jamie Zawinski, Ben Wing, Martin Buchholz, and Steve Baur
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 # Maintainer: Hrvoje Niksic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 # Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 # This file is part of XEmacs.
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
10 #
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
11 # XEmacs is free software: you can redistribute it and/or modify it
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
12 # under the terms of the GNU General Public License as published by the
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
13 # Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
14 # option) any later version.
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
15 #
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
16 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
19 # for more details.
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
20 #
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 428
diff changeset
22 # along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ### Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 # This is much simpler than update-autoloads.el. All we need to do is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 # compute a list of directories we want to use, and feed it to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 # Custom-make-dependencies. End of story.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 ### Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 set -eu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 # get to the right directory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 test ! -d ./lisp -a -d ../lisp && cd ..
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 if test ! -d ./lisp ; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 echo $0: neither ./lisp/ nor ../lisp/ exist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 exit 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 test -z "$EMACS" && EMACS="./src/xemacs"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 echo " (using $EMACS)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 export EMACS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 EMACS_DIR=`cd \`dirname $EMACS\` && pwd`;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 # Account for various system automounter configurations
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 if test -d "/net"; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 if test -d "/tmp_mnt/net"; then tdir="/tmp_mnt/net"; else tdir="/tmp_mnt"; fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 EMACS_DIR=`echo "$EMACS_DIR" | \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 REAL="$EMACS_DIR/`basename $EMACS`"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 echo "Rebuilding custom-loads with $REAL..."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 echon()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 /bin/echo $* '\c'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 echon()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 echo -n $*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 # Compute patterns to ignore when searching for files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 ignore_dirs=""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 echon "Checking for Mule support..."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 lisp_prog='(princ (featurep (quote mule)))'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 mule_p="`$EMACS -batch -q -no-site-file -eval \"$lisp_prog\"`"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 if test "$mule_p" = nil ; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 echo No
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 ignore_dirs="$ignore_dirs mule"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 echo Yes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 echon "Checking directories..."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 dirs=lisp/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 for dir in lisp/*; do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 if test -d $dir \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 -a $dir != lisp/CVS \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 -a $dir != lisp/SCCS; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 for ignore in $ignore_dirs; do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 if test $dir = lisp/$ignore; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 continue 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 done
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 rm -f "$dir/custom-load.elc"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 dirs="$dirs $dir"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 done
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 echo done
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 $EMACS -batch -q -no-site-file -l cus-dep -f Custom-make-dependencies $dirs