]> code.delx.au - gnu-emacs/blobdiff - admin/quick-install-emacs
*** empty log message ***
[gnu-emacs] / admin / quick-install-emacs
index c6ea67eb418695331511351b9ec7f45951101b10..9a9d1203d96e7163628f0cdc55249d586efd700a 100755 (executable)
@@ -8,7 +8,7 @@
 PUBLIC_LIBSRC_BINARIES='b2m emacsclient etags ctags ebrowse'
 PUBLIC_LIBSRC_SCRIPTS='grep-changelog rcs-checkin'
 
-AVOID="CVS -DIC README COPYING ChangeLog ~ Makefile makefile stamp-subdir .cvsignore \.[cho]$ make-docfile testfile test-distrib"
+AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile makefile stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile testfile test-distrib"
 
 # Prune old binaries lying around in the source tree
 PRUNE=no
@@ -19,18 +19,22 @@ VERBOSE=''
 
 me="`basename $0`"
 
-# Install commands (these commands are also expected to understand the
-# GNU -v (--verbose) option)
+# Install commands (if the user specifies the `--verbose' option, it is
+# passed to these commands, so that feature only works if these commands
+# implement it too)
 LINK='cp -lf'
 COPY='cp -f'
 REMOVE='rm -r'
+MKDIR='mkdir -p'
 
 # Used to execute commands once once we create them
 EXEC='sh'
-MKDIR='mkdir --verbose -p'
 
 NAWK=/usr/bin/nawk
 
+# avoid non-standard command output from non-C locales
+unset LANG LC_ALL LC_MESSAGES
+
 # Some messages
 USAGE="Usage: $me [OPTION...] BUILD_TREE [PREFIX]"
 TRY="Try "\`"$me --help' for more information."
@@ -87,7 +91,7 @@ EOF
       ;;
     --version)
       cat <<EOF
-$me 1.5
+$me 1.6
 
 Written by Miles Bader <miles@gnu.org>
 EOF
@@ -130,27 +134,31 @@ elif test ! -r "$BUILD/config.status"; then
 fi
 
 CONFIG_STATUS="$BUILD/config.status"
-function get_config_var () {
-  if ! $NAWK -F% '$2 == "@'$1'@" { print $3; ok=1; exit; }; END { exit(!ok); }' $CONFIG_STATUS
+get_config_var ()
+{
+  if ! sed -n "s/^s\(.\)@$1@\1\(.*\)\1.*$/\2/p" $CONFIG_STATUS | sed q | grep ''
   then
     echo 1>&2 "$me: $1: Configuration variable not found in $CONFIG_STATUS"
     exit 4
   fi
 }
 
-test x"$SRC" = x && SRC="`get_config_var srcdir`"
-test x"$prefix" = x && prefix="`get_config_var prefix`"
-test x"$VERSION" = x && VERSION="`get_config_var version`"
-test x"$ARCH" = x && ARCH="`get_config_var host`"
+test x"$SRC" = x && { SRC="`get_config_var srcdir`" || exit 4 ; }
+test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
+test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
+
+VERSION=`grep 'defconst[        ]*emacs-version' $SRC/lisp/version.el \
+         | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 
 DST_SHARE="$prefix/share/emacs/$VERSION"
 DST_BIN="$prefix/bin"
 DST_LIBEXEC="$prefix/libexec/emacs/$VERSION/$ARCH"
 DST_INFO="$prefix/info"
 
-function maybe_mkdir () {
+maybe_mkdir ()
+{
   if ! test -d "$1"; then
-    $MKDIR "$1" 2>&1 | sed "s/^mkdir:/$me:/" 1>&2
+    $MKDIR $VERBOSE "$1" 2>&1 | sed "s/^mkdir:/$me:/" 1>&2
   fi
 }
 
@@ -164,15 +172,11 @@ maybe_mkdir "$DST_INFO"
 
 PRUNED=""
 if test x"$PRUNE" != xno; then
-  for D in `ls -1t $BUILD/etc/DOC-* | tail +2`; do
+  for D in `ls -1t $BUILD/etc/DOC-* | sed 1d`; do
     echo $REMOVE_CMD $D
     PRUNED="$PRUNED $D"
   done
-  for D in `ls -1t $BUILD/src/emacs-$VERSION.* | tail +2`; do
-    echo $REMOVE_CMD $D
-    PRUNED="$PRUNED $D"
-  done
-  for D in `ls -1t $BUILD/lib-src/fns-* | tail +2`; do
+  for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do
     echo $REMOVE_CMD $D
     PRUNED="$PRUNED $D"
   done
@@ -180,7 +184,8 @@ fi
 
 test x"$PRUNE" = xonly && exit 0
 
-function maybe_emit_copy () {
+maybe_emit_copy ()
+{
   if test "$FORCE" = yes || ! cmp -s $1 $2; then
     echo $LINK_CMD $1 $2
   fi
@@ -333,3 +338,5 @@ END {
 done
 
 ) | eval $EXEC
+
+# arch-tag: 9322b572-9755-4cf7-a67a-21e6505f1477