annotate admin/quick-install-emacs @ 45879:92c22a8f55a6

Document mouse-highlight variable.
author Richard M. Stallman <rms@gnu.org>
date Mon, 17 Jun 2002 16:27:58 +0000
parents 99b2cc9b795c
children a22f8991ae27
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
1 #!/bin/sh
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
2 # quick-install-emacs -- do a halfway-decent job of installing emacs quickly
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
3 # Written by Miles Bader <miles@gnu.org>
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
4
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
5 # This script is mainly intended for emacs maintainer or pretesters who
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
6 # install emacs very often. See the --help output for more details.
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
7
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
8 PUBLIC_LIBSRC_BINARIES='b2m emacsclient etags ctags ebrowse'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
9 PUBLIC_LIBSRC_SCRIPTS='grep-changelog rcs-checkin'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
10
40064
90451d9e7e0e Exit if we can't find some variable.
Miles Bader <miles@gnu.org>
parents: 39041
diff changeset
11 AVOID="CVS -DIC README COPYING ChangeLog ~ \.orig$ \.rej$ Makefile makefile stamp-subdir .cvsignore \.[cho]$ make-docfile testfile test-distrib"
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
12
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
13 # Prune old binaries lying around in the source tree
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
14 PRUNE=no
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
15 # Re-install files even if they already exist
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
16 FORCE=no
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
17 # Command verbose flag
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
18 VERBOSE=''
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
19
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 me="`basename $0`"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
21
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
22 # Install commands (these commands are also expected to understand the
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
23 # GNU -v (--verbose) option)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
24 LINK='cp -lf'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
25 COPY='cp -f'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
26 REMOVE='rm -r'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
27
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
28 # Used to execute commands once once we create them
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
29 EXEC='sh'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
30 MKDIR='mkdir --verbose -p'
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
31
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
32 NAWK=/usr/bin/nawk
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
33
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
34 # Some messages
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
35 USAGE="Usage: $me [OPTION...] BUILD_TREE [PREFIX]"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
36 TRY="Try "\`"$me --help' for more information."
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
37
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
38 # Parse command-line options
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
39 while :; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
40 case "$1" in
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
41 -n|--dry-run)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
42 EXEC=cat; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
43 -p|--prune)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
44 PRUNE=yes; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
45 -P|--no-prune)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
46 PRUNE=no; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
47 --prune-only)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
48 PRUNE=only; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
49 -f|--force)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
50 FORCE=yes; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
51 -v|--verbose)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
52 VERBOSE="-v"; shift;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
53 --help)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
54 cat <<EOF
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
55 $USAGE
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
56 Install emacs quickly
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
57
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
58 -n, --dry-run print installation commands instead of
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
59 executing them
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
60
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
61 -f, --force install even files that haven't changed
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 -v, --verbose print messages describing what is done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
63
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
64 -p, --prune prune old generated files
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
65 -P, --no-prune don't prune old generated files (default)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
66 --prune-only prune old generated files, but don't install
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
67
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
68 --help display this help and exit
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
69 --version output version information and exit
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
70
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
71 $me install emacs \`incrementally,' that is, it will
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
72 install only those files that have changed since the last time it was
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
73 invoked, and remove any obsolete files from the installation
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
74 directories. It also uses hard-links into the source and build trees to
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
75 do the install, so it uses much less space than the default Makefile
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
76 install target; however, this also means that $me can
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
77 not install onto a disk partition other than the one on which the source
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
78 and build directories reside.
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
79
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
80 Optionally, $me can also remove old versions of
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
81 automatically generated files that are version-specific (such as the
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
82 versioned emacs executables in the \`src' directory, and the DOC-* files
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
83 in the \`etc' directory). The latter action is called \`pruning,' and
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
84 can be enabled using the \`-p' or \`--prune' options.
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
85 EOF
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
86 exit 0
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
87 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
88 --version)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
89 cat <<EOF
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
90 $me 1.5
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
91
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
92 Written by Miles Bader <miles@gnu.org>
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
93 EOF
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
94 exit 0
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
95 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
96 -[^-]?*)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
97 # split concatenated single-letter options apart
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
98 FIRST="$1"; shift
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
99 set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
100 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
101 -*)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
102 echo 1>&2 "$me: unrecognized option "\`"$1'"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
103 echo 1>&2 "$TRY"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
104 exit 1
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
105 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
106 *)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
107 break;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
108 esac
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
109 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
110
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
111 LINK_CMD="$LINK $VERBOSE"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
112 REMOVE_CMD="$REMOVE $VERBOSE"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
113
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
114 case $# in
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
115 1) BUILD="$1";;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
116 2) BUILD="$1"; prefix="$2";;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
117 *)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
118 echo 1>&2 "$USAGE"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
119 echo 1>&2 "$TRY"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
120 exit 1
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
121 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
122 esac
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
123
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
124 if test ! -d "$BUILD"; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
125 echo 1>&2 "$me: $BUILD: Build tree not found"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
126 exit 2
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
127 elif test ! -r "$BUILD/config.status"; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
128 echo 1>&2 "$me: $BUILD: Not a proper build tree, config.status not found"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
129 exit 2
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
130 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
131
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
132 CONFIG_STATUS="$BUILD/config.status"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
133 function get_config_var () {
44112
271a4f9d12fc (PRUNED): Avoid "head -1" and "tail +2", as POSIX 1003.1-2001
Paul Eggert <eggert@twinsun.com>
parents: 40064
diff changeset
134 if ! sed -n "s/^s\(.\)@$1@\1\(.*\)\1.*$/\2/p" $CONFIG_STATUS | sed q | grep ''
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
135 then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
136 echo 1>&2 "$me: $1: Configuration variable not found in $CONFIG_STATUS"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
137 exit 4
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
138 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
139 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
140
40064
90451d9e7e0e Exit if we can't find some variable.
Miles Bader <miles@gnu.org>
parents: 39041
diff changeset
141 test x"$SRC" = x && { SRC="`get_config_var srcdir`" || exit 4 ; }
90451d9e7e0e Exit if we can't find some variable.
Miles Bader <miles@gnu.org>
parents: 39041
diff changeset
142 test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
90451d9e7e0e Exit if we can't find some variable.
Miles Bader <miles@gnu.org>
parents: 39041
diff changeset
143 test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
144
45539
99b2cc9b795c (VERSION): Calculate using the same method that configure.in uses.
Miles Bader <miles@gnu.org>
parents: 44112
diff changeset
145 VERSION=`grep 'defconst[ ]*emacs-version' $SRC/lisp/version.el \
99b2cc9b795c (VERSION): Calculate using the same method that configure.in uses.
Miles Bader <miles@gnu.org>
parents: 44112
diff changeset
146 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
99b2cc9b795c (VERSION): Calculate using the same method that configure.in uses.
Miles Bader <miles@gnu.org>
parents: 44112
diff changeset
147
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
148 DST_SHARE="$prefix/share/emacs/$VERSION"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
149 DST_BIN="$prefix/bin"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
150 DST_LIBEXEC="$prefix/libexec/emacs/$VERSION/$ARCH"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
151 DST_INFO="$prefix/info"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
152
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
153 function maybe_mkdir () {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
154 if ! test -d "$1"; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
155 $MKDIR "$1" 2>&1 | sed "s/^mkdir:/$me:/" 1>&2
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
156 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
157 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
158
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
159 maybe_mkdir "$DST_BIN"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
160 maybe_mkdir "$DST_SHARE"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
161 maybe_mkdir "$DST_SHARE/site-lisp"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
162 maybe_mkdir "$DST_LIBEXEC"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
163 maybe_mkdir "$DST_INFO"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
164
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
165 ( # start of command-generating sub-shell
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
166
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
167 PRUNED=""
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
168 if test x"$PRUNE" != xno; then
44112
271a4f9d12fc (PRUNED): Avoid "head -1" and "tail +2", as POSIX 1003.1-2001
Paul Eggert <eggert@twinsun.com>
parents: 40064
diff changeset
169 for D in `ls -1t $BUILD/etc/DOC-* | sed 1d`; do
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
170 echo $REMOVE_CMD $D
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
171 PRUNED="$PRUNED $D"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
172 done
44112
271a4f9d12fc (PRUNED): Avoid "head -1" and "tail +2", as POSIX 1003.1-2001
Paul Eggert <eggert@twinsun.com>
parents: 40064
diff changeset
173 for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
174 echo $REMOVE_CMD $D
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
175 PRUNED="$PRUNED $D"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
176 done
44112
271a4f9d12fc (PRUNED): Avoid "head -1" and "tail +2", as POSIX 1003.1-2001
Paul Eggert <eggert@twinsun.com>
parents: 40064
diff changeset
177 for D in `ls -1t $BUILD/lib-src/fns-* | sed 1d`; do
39041
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
178 echo $REMOVE_CMD $D
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
179 PRUNED="$PRUNED $D"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
180 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
181 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
182
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
183 test x"$PRUNE" = xonly && exit 0
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
184
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
185 function maybe_emit_copy () {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
186 if test "$FORCE" = yes || ! cmp -s $1 $2; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
187 echo $LINK_CMD $1 $2
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
188 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
189 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
190
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
191 maybe_emit_copy $BUILD/src/emacs $DST_BIN/emacs
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
192 maybe_emit_copy $BUILD/src/emacs $DST_BIN/emacs-$VERSION
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
193
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
194 for F in $PUBLIC_LIBSRC_BINARIES; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
195 maybe_emit_copy $BUILD/lib-src/$F $DST_BIN/$F
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
196 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
197 for F in $PUBLIC_LIBSRC_SCRIPTS; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
198 maybe_emit_copy $SRC/lib-src/$F $DST_BIN/$F
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
199 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
200
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
201 if test x"$SRC" = x"$BUILD"; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
202 PFXS="$BUILD"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
203 else
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
204 PFXS="$SRC $BUILD"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
205 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
206
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
207 for SUBDIR in lisp leim etc lib-src info; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
208 # defaults
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
209 SHARED=no
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
210 FORCED=''
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
211 AVOID_PAT="`echo "($AVOID)" | tr ' ' '|'`"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
212
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
213 # Set subdir-specific values
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
214 case $SUBDIR in
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
215 lisp|leim)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
216 DST="$DST_SHARE/$SUBDIR"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
217 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
218 etc)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
219 DST="$DST_SHARE/$SUBDIR"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
220 # COPYING is in the avoid list, but there should be a copy of it in
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
221 # the install etc dir, so make that here.
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
222 FORCED="$DST/COPYING"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
223 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
224 lib-src)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
225 DST="$DST_LIBEXEC"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
226 AVOID_PAT="`echo "($AVOID ($PUBLIC_LIBSRC_BINARIES $PUBLIC_LIBSRC_SCRIPTS)\$)" | tr ' ' '|'`"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
227 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
228 info)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
229 DST="$DST_INFO"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
230 SHARED=yes
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
231 ;;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
232 esac
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
233
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
234 for PFX in $PFXS; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
235 if [ -d $PFX/$SUBDIR ]; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
236 for DIR in `(cd $PFX/$SUBDIR; find . -type d -print | sed 's@^./@@')`; do
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
237 if [ -d $DST/$DIR ]; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
238 echo Directory $DST/$DIR exists
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
239 else
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
240 echo Directory $DST/$DIR non-existant
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
241 if [ "`echo $DIR | egrep -v "$AVOID_PAT"`" ]; then
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
242 maybe_mkdir $DST/$DIR
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
243 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
244 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
245 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
246 diff -sqr $PFX/$SUBDIR $DST
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
247 fi
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
248 done | $NAWK '
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
249 BEGIN {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
250 src_pat = "^'"$SRC"'/'"$SUBDIR"'/"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
251 build_pat = "^'"$BUILD"'/'"$SUBDIR"'/"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
252 dst_pat = "^'"$DST"'/"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
253 dst_pfx = "'"$DST"'/"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
254 avoid_pat = "'"$AVOID_PAT"'"
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
255 force = ("'"$FORCE"'" == "yes")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
256 shared = ("'"$SHARED"'" == "yes")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
257 init_bool_array(pruned, "'"$PRUNED"'")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
258 init_bool_array(forced, "'"$FORCED"'")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
259 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
260 function init_bool_array(array, string, a,k)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
261 {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
262 split (string, a)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
263 for (k in a)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
264 array[a[k]] = 1
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
265 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
266 function install(src, dst)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
267 {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
268 if (! (src in pruned)) {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
269 cp[src] = dst;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
270 from[dst] = src;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
271 delete rm[dst];
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
272 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
273 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
274 function update(src, dst, copy)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
275 {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
276 if (src in pruned) {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
277 rm[dst] = 1;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
278 delete from[dst]
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
279 } else {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
280 if (copy)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
281 cp[src] = dst;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
282 from[dst] = src;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
283 delete rm[dst];
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
284 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
285 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
286 function uninstall(dst)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
287 {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
288 if (!(dst in from))
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
289 rm[dst] = 1;
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
290 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
291 /^Directory / {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
292 if ($2 ~ avoid_pat) {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
293 if ($NF == "exists")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
294 uninstall($2)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
295 } else
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
296 update(0, $2, 0)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
297 next
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
298 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
299 /^Files / {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
300 if ($4 ~ avoid_pat && !($4 in forced))
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
301 uninstall($4)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
302 else if ($NF == "identical")
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
303 update($2, $4, force)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
304 else
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
305 update($2, $4, 1)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
306 next
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
307 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
308 /^Only / {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
309 pfx = $3
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
310 sub (/:$/, "/", pfx)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
311
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
312 if (pfx ~ dst_pat) {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
313 if (! shared)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
314 uninstall(pfx $4)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
315 } else {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
316 subdir = pfx
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
317 if (subdir ~ src_pat)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
318 sub (src_pat, "", subdir)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
319 else
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
320 sub (build_pat, "", subdir)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
321
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
322 dst = dst_pfx subdir $4
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
323 if (! (dst ~ avoid_pat))
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
324 install(pfx $4, dst)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
325 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
326 next
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
327 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
328 END {
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
329 for (f in rm)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
330 print "'"$REMOVE_CMD"' " f
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
331 for (f in cp)
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
332 print "'"$LINK_CMD"' " f " " cp[f]
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
333 }
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
334 '
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
335 done
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
336
bd5875aba018 Initial checkin.
Miles Bader <miles@gnu.org>
parents:
diff changeset
337 ) | eval $EXEC