annotate lib-src/update-custom.sh @ 423:28d9c139be4c

Added tag r21-2-19 for changeset 95016f13131a
author cvs
date Mon, 13 Aug 2007 11:25:03 +0200
parents 1f50e6fe4f3f
children
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
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 276
diff changeset
43 test -z "$EMACS" && EMACS="./src/xemacs"
195
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
392
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
48 EMACS_DIR=`cd \`dirname $EMACS\` && pwd`;
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
49 # Account for various system automounter configurations
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
50 if test -d "/net"; then
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
51 if test -d "/tmp_mnt/net"; then tdir="/tmp_mnt/net"; else tdir="/tmp_mnt"; fi
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
52 EMACS_DIR=`echo "$EMACS_DIR" | \
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
53 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
54 fi
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
55 REAL="$EMACS_DIR/`basename $EMACS`"
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
56
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
57 echo "Rebuilding custom-loads with $REAL..."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
58
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
59 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
60 echon()
392
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
61 {
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
62 /bin/echo $* '\c'
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
63 }
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
64 else
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
65 echon()
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
66 {
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
67 echo -n $*
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
68 }
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
69 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
70
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
71 # Compute patterns to ignore when searching for files
392
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
72 ignore_dirs=""
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
73
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
74 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
75 echon "Checking for Mule support..."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
76 lisp_prog='(princ (featurep (quote mule)))'
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
77 mule_p="`$EMACS -batch -q -no-site-file -eval \"$lisp_prog\"`"
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
78 if test "$mule_p" = nil ; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
79 echo No
392
1f50e6fe4f3f Import from CVS: tag r21-2-11
cvs
parents: 371
diff changeset
80 ignore_dirs="$ignore_dirs mule"
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
81 else
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
82 echo Yes
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
83 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
84
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
85 echon "Checking directories..."
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 239
diff changeset
86 dirs=lisp/
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
87 for dir in lisp/*; do
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
88 if test -d $dir \
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
89 -a $dir != lisp/CVS \
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
90 -a $dir != lisp/SCCS; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
91 for ignore in $ignore_dirs; do
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
92 if test $dir = lisp/$ignore; then
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
93 continue 2
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
94 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
95 done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
96 rm -f "$dir/custom-load.elc"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
97 dirs="$dirs $dir"
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
98 fi
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
99 done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
100 echo done
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents:
diff changeset
101
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 219
diff changeset
102 $EMACS -batch -q -no-site-file -l cus-dep -f Custom-make-dependencies $dirs