* config/elisp-comp, config/install-sh, config/mdate-sh,

config/missing, config/mkinstalldirs: Sync from Automake.
This commit is contained in:
Ralf Wildenhues 2006-04-06 22:40:55 +00:00
parent df756e0046
commit 20d3a16322
6 changed files with 236 additions and 92 deletions

View File

@ -1,5 +1,8 @@
2006-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* config/elisp-comp, config/install-sh, config/mdate-sh,
config/missing, config/mkinstalldirs: Sync from Automake.
* lib/Autom4te/FileUtils.pm, lib/Autom4te/Struct.pm: Sync
from Automake.

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc.
# Copyright (C) 1995, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
scriptversion=2003-11-08.23
scriptversion=2005-05-14.22
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1995.
#
@ -47,11 +47,11 @@ they require or load-library one another.
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
exit $?
;;
-v | --v*)
echo "elisp-comp $scriptversion"
exit 0
exit $?
;;
esac
@ -64,7 +64,7 @@ fi
tempdir=elc.$$
# Cleanup the temporary directory on exit.
trap 'status=$?; rm -rf "$tempdir" && exit $status' 0
trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
mkdir $tempdir
@ -77,7 +77,7 @@ cp "$@" $tempdir
mv *.elc ..
) || exit $?
(exit 0); exit
(exit 0); exit 0
# Local Variables:
# mode: shell-script

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2004-12-17.09
scriptversion=2006-01-12.21
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -58,7 +58,21 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
posix_glob=
posix_mkdir=
# Symbolic mode for testing mkdir with directories.
# It is the same as 755, but also tests that "u+" works.
test_mode=u=rwx,g=rx,o=rx,u+wx
# Desired mode of installed file.
mode=0755
# Desired mode of newly created intermediate directories.
# It is empty if not known yet.
intermediate_mode=
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
@ -109,9 +123,9 @@ while test -n "$1"; do
shift
continue;;
--help) echo "$usage"; exit 0;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
-m) mode=$2
shift
shift
continue;;
@ -134,7 +148,7 @@ while test -n "$1"; do
shift
continue;;
--version) echo "$0 $scriptversion"; exit 0;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@ -164,6 +178,8 @@ if test -z "$1"; then
exit 0
fi
test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
for src
do
# Protect names starting with `-'.
@ -173,15 +189,11 @@ do
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@ -208,53 +220,134 @@ do
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
obsolete_mkdir_used=false
# Make sure that the destination directory exists.
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
posix_mkdir=false
if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
posix_mkdir=true
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
fi ;;
esac
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
if
$posix_mkdir && {
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
# With -d, create the new directory with the user-specified mode.
# Otherwise, create it using the same intermediate mode that
# mkdir -p would use when creating intermediate directories.
# POSIX says that this mode is "$(umask -S),u+wx", so use that
# if umask -S works.
pathcomp=
if test -n "$dir_arg"; then
mkdir_mode=$mode
else
case $intermediate_mode in
'')
if umask_S=`(umask -S) 2>/dev/null`; then
intermediate_mode=$umask_S,u+wx
else
intermediate_mode=$test_mode
fi ;;
esac
mkdir_mode=$intermediate_mode
fi
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
$mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
}
then :
else
# mkdir does not conform to POSIX, or it failed possibly due to
# a race condition. Create the directory the slow way, step by
# step, checking for races as we go.
case $dstdir in
/*) pathcomp=/ ;;
-*) pathcomp=./ ;;
*) pathcomp= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
$posix_glob && set +f
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# Don't fail if two instances are running concurrently.
test -d "$pathcomp" || exit 1
fi
pathcomp=$pathcomp/
done
obsolete_mkdir_used=true
fi
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@ -262,7 +355,6 @@ do
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
@ -276,10 +368,10 @@ do
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
&& { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
@ -291,11 +383,12 @@ do
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
@ -304,16 +397,13 @@ do
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
$doit $mvcmd "$dsttmp" "$dst"
}
}
fi || { (exit 1); exit 1; }
done
} || exit 1
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)

View File

@ -1,9 +1,10 @@
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
scriptversion=2004-12-08.12
scriptversion=2005-06-29.22
# Copyright (C) 1995, 1996, 1997, 2003, 2004 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
# Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# This program is free software; you can redistribute it and/or modify
@ -42,11 +43,11 @@ Pretty-print the modification time of FILE.
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
exit 0
exit $?
;;
esac
@ -58,7 +59,15 @@ export LC_ALL
LC_TIME=C
export LC_TIME
save_arg1="$1"
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume `unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
export TIME_STYLE
fi
save_arg1=$1
# Find out how to get the extended ls output of a file or directory.
if ls -L /dev/null 1>/dev/null 2>&1; then
@ -107,13 +116,32 @@ do
done
# Get the extended ls output of the file or directory.
set x`eval "$ls_command \"\$save_arg1\""`
set dummy x`eval "$ls_command \"\$save_arg1\""`
# Remove all preceding arguments
eval $command
# Get the month. Next argument is day, followed by the year or time.
case $1 in
# Because of the dummy argument above, month is in $2.
#
# On a POSIX system, we should have
#
# $# = 5
# $1 = file size
# $2 = month
# $3 = day
# $4 = year or time
# $5 = filename
#
# On Darwin 7.7.0 and 7.6.0, we have
#
# $# = 4
# $1 = day
# $2 = month
# $3 = year or time
# $4 = filename
# Get the month.
case $2 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
@ -128,7 +156,10 @@ case $1 in
Dec) month=December; nummonth=12;;
esac
day=$2
case $3 in
???*) day=$1;;
*) day=$3; shift;;
esac
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2004-09-07.08
scriptversion=2006-01-12.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@ -87,12 +87,12 @@ Supported PROGRAM values:
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit 0
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit 0
exit $?
;;
-*)
@ -288,11 +288,23 @@ WARNING: \`$1' is $msg. You should only need it if
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;

View File

@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2004-02-15.20
scriptversion=2005-06-29.22
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
@ -12,7 +12,7 @@ scriptversion=2004-02-15.20
# <automake-patches@gnu.org>.
errstatus=0
dirmode=""
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@ -27,7 +27,7 @@ while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit 0
exit $?
;;
-m) # -m PERM arg
shift
@ -37,7 +37,7 @@ while test $# -gt 0 ; do
;;
--version)
echo "$0 $scriptversion"
exit 0
exit $?
;;
--) # stop option processing
shift
@ -103,13 +103,21 @@ esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
pathcomp=
for d
do
pathcomp="$pathcomp$d"
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
@ -124,7 +132,7 @@ do
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
@ -134,7 +142,7 @@ do
fi
fi
pathcomp="$pathcomp/"
pathcomp=$pathcomp/
done
done