#!/bin/sh
### quick-install-emacs --- do a halfway-decent job of installing emacs quickly
-## Copyright (C) 2001-2014 Free Software Foundation, Inc.
+## Copyright (C) 2001-2016 Free Software Foundation, Inc.
## Author: Miles Bader <miles@gnu.org>
me="`basename $0`"
-# Install commands (if the user specifies the `--verbose' option, it is
+# 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'
# Some messages
USAGE="Usage: $me [OPTION...] BUILD_TREE [PREFIX]"
-TRY="Try "\`"$me --help' for more information."
+TRY="Try '$me --help' for more information."
# Parse command-line options
while :; do
--help display this help and exit
--version output version information and exit
-$me install emacs \`incrementally,' that is, it will
+$me install emacs "incrementally", that is, it will
install only those files that have changed since the last time it was
invoked, and remove any obsolete files from the installation
directories. It also uses hard-links into the source and build trees to
Optionally, $me can also remove old versions of
automatically generated files that are version-specific (such as the
-versioned emacs executables in the \`src' directory).
-The latter action is called \`pruning,' and
-can be enabled using the \`-p' or \`--prune' options.
+versioned emacs executables in the 'src' directory).
+The latter action is called "pruning", and
+can be enabled using the '-p' or '--prune' options.
EOF
exit 0
;;
-[!-]?*)
# split concatenated single-letter options apart
FIRST="$1"; shift
- set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
+ set -- `printf '%s\n' "$FIRST" | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
;;
-*)
- echo 1>&2 "$me: unrecognized option "\`"$1'"
- echo 1>&2 "$TRY"
+ printf '%s\n' >&2 "$me: unrecognized option '$1'"
+ printf '%s\n' >&2 "$TRY"
exit 1
;;
*)
1) BUILD="$1";;
2) BUILD="$1"; prefix="$2";;
*)
- echo 1>&2 "$USAGE"
- echo 1>&2 "$TRY"
+ printf '%s\n' >&2 "$USAGE"
+ printf '%s\n' >&2 "$TRY"
exit 1
;;
esac
if test ! -d "$BUILD"; then
- echo 1>&2 "$me: $BUILD: Build tree not found"
+ printf '%s\n' >&2 "$me: $BUILD: Build tree not found"
exit 2
elif test ! -r "$BUILD/config.status"; then
- echo 1>&2 "$me: $BUILD: Not a proper build tree, config.status not found"
+ printf '%s\n' >&2 \
+ "$me: $BUILD: Not a proper build tree, config.status not found"
exit 2
fi
{ sed -n "s/^S[[]\"$1\"[]]=\"\([^\"]*\)\"/\1/p" $CONFIG_STATUS | sed q | grep ''; } ||
{ sed -n "s/^s\(.\)@$1@\1\(|#_!!_#|\)*\(.*\)\1.*$/\3/p" $CONFIG_STATUS | sed q | grep ''; } ||
{
- echo 1>&2 "$me: $1: Configuration variable not found in $CONFIG_STATUS"
+ printf '%s\n' >&2 \
+ "$me: $1: Configuration variable not found in $CONFIG_STATUS"
exit 4
}
}
VERSION=`
sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <$SRC/configure.ac
` || exit 4
-test -n "$VERSION" || { echo >&2 "$me: no version in configure.ac"; exit 4; }
+test -n "$VERSION" || { printf '%s\n' >&2 "$me: no version in configure.ac"; exit 4; }
DST_SHARE="$prefix/share/emacs/$VERSION"
DST_BIN="$prefix/bin"
PRUNED=""
if test x"$PRUNE" != xno; then
for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do
- echo $REMOVE_CMD $D
+ printf '%s\n' "$REMOVE_CMD $D"
PRUNED="$PRUNED $D"
done
fi
maybe_emit_copy ()
{
if test "$FORCE" = yes || ! cmp -s $1 $2; then
- echo $LINK_CMD $1 $2
+ printf '%s\n' "$LINK_CMD $1 $2"
fi
}
# defaults
SHARED=no
FORCED=''
- AVOID_PAT="`echo "($AVOID)" | tr ' ' '|'`"
+ AVOID_PAT="`printf '%s\n' "($AVOID)" | tr ' ' '|'`"
# Set subdir-specific values
case $SUBDIR in
;;
lib-src)
DST="$DST_LIBEXEC"
- AVOID_PAT="`echo "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`"
+ AVOID_PAT="`printf '%s\n' "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`"
;;
info)
DST="$DST_INFO"
if [ -d $PFX/$SUBDIR ]; then
for DIR in `(cd $PFX/$SUBDIR; find . -type d -print | sed 's@^./@@')`; do
if [ -d $DST/$DIR ]; then
- echo Directory $DST/$DIR exists
+ printf '%s\n' "Directory $DST/$DIR exists"
else
- echo Directory $DST/$DIR non-existent
- if [ "`echo $DIR | egrep -v "$AVOID_PAT"`" ]; then
+ printf '%s\n' "Directory $DST/$DIR non-existent"
+ if [ "`printf '%s\n' "$DIR" | grep -Ev "$AVOID_PAT"`" ]; then
maybe_mkdir $DST/$DIR
fi
fi