annotate lib-src/update-custom.sh @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents 41f2f0e326e9
children 7df0dd720c89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
1 #!/bin/sh
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
2 ### update-custom.sh --- update Customize group dependencies
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
3
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
4 # Author: Hrvoje Niksic, based on update-autoloads.el by
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
5 # Jamie Zawinski, Ben Wing, Martin Buchholz, and Steve Baur
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
6 # Maintainer: Hrvoje Niksic
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
7 # Keywords: internal
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
8
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
9 # This file is part of XEmacs.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
10
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
11 # XEmacs is free software; you can redistribute it and/or modify it
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
12 # under the terms of the GNU General Public License as published by
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
13 # the Free Software Foundation; either version 2, or (at your option)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
14 # any later version.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
15
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
16 # XEmacs is distributed in the hope that it will be useful, but
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
19 # General Public License for more details.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
20
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
22 # along with XEmacs; see the file COPYING. If not, write to
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
23 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
24 # Boston, MA 02111-1307, USA.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
25
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
26 ### Commentary:
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
27
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
28 # This is much simpler than update-autoloads.el. All we need to do is
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
29 # compute a list of directories we want to use, and feed it to
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
30 # Custom-make-dependencies. End of story.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
31
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
32 ### Code:
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
33
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
34 set -eu
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
35
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
36 # get to the right directory
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
37 test ! -d ./lisp -a -d ../lisp && cd ..
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
38 if test ! -d ./lisp ; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
39 echo $0: neither ./lisp/ nor ../lisp/ exist
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
40 exit 1
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
41 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
42
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
43 EMACS="./src/xemacs"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
44 echo " (using $EMACS)"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
45
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
46 export EMACS
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
47
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
48 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
49
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
50 echo "Rebuilding custom-loads with $REAL..."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
51
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
52 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
53 echon()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
54 {
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
55 /bin/echo $* '\c'
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
56 }
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
57 else
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
58 echon()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
59 {
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
60 echo -n $*
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
61 }
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
62 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
63
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
64 # Compute patterns to ignore when searching for files
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
65 # These directories don't have customizations, or are partially broken.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
66 # If some of the packages listed here are customized, don't forget to
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
67 # remove the directory!
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 207
diff changeset
68 ignore_dirs="cl egg eos its language locale sunpro term \
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 207
diff changeset
69 tooltalk iso electric \
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
70 hm--html-menus gnats pcl-cvs vm"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
71
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
72 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
73 echon "Checking for Mule support..."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
74 lisp_prog='(princ (featurep (quote mule)))'
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
75 mule_p="`$EMACS -batch -q -no-site-file -eval \"$lisp_prog\"`"
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
76 if test "$mule_p" = nil ; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
77 echo No
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 209
diff changeset
78 ignore_dirs="$ignore_dirs mule leim skk"
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
79 else
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
80 echo Yes
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
81 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
82
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
83 echon "Checking directories..."
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 239
diff changeset
84 dirs=lisp/
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
85 for dir in lisp/*; do
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
86 if test -d $dir \
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
87 -a $dir != lisp/CVS \
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
88 -a $dir != lisp/SCCS; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
89 for ignore in $ignore_dirs; do
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
90 if test $dir = lisp/$ignore; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
91 continue 2
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
92 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
93 done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
94 rm -f "$dir/custom-load.elc"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
95 dirs="$dirs $dir"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
96 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
97 done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
98 echo done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
99
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
100 $EMACS -batch -q -no-site-file -l cus-dep -f Custom-make-dependencies $dirs