[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Automake branch, branch-1-10, updated. Release-1-10-65-g95beb4
From: |
Ralf Wildenhues |
Subject: |
[SCM] GNU Automake branch, branch-1-10, updated. Release-1-10-65-g95beb49 |
Date: |
Sat, 19 Jan 2008 09:07:44 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=95beb49e9111842b1da6c16a195ac041b63a41a2
The branch, branch-1-10 has been updated
via 95beb49e9111842b1da6c16a195ac041b63a41a2 (commit)
via 26ee0fb7d55bf631c91a0d7ca12bbaaeddbb9f1f (commit)
from 84954c88ac90157bbabca6e796654ff2c3b05dc5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 95beb49e9111842b1da6c16a195ac041b63a41a2
Author: Ralf Wildenhues <address@hidden>
Date: Sat Jan 19 10:02:48 2008 +0100
Backport second install-sh patch from master branch:
2006-12-25 Paul Eggert <address@hidden>
* lib/install-sh (initialize_posix_glob): New var.
Use it instead of setting posix_glob inline.
(posix_glob): Use '?'/''/: instead of ''/yes/no, for convenience.
(cmpprog, CMPPROG): New vars, since we use cmp rather than the diff
of Akim's patch.
Use LC_ALL before invoking 'ls' when we depend on its output format.
Don't use awk; just use the shell's builtin features.
Clean up $dsttmp -C detects no installation is needed.
* tests/defs.in (is_newest): Renamed from is_younger; the new
name is more accurate. All uses changed.
(old_timestamp): New var.
* tests/instsh2.test: Rewrite to avoid the need for sleeping.
2006-12-25 Akim Demaille <address@hidden>
* lib/install-sh: Implement install-sh -C.
(This patch is the remaining part of the patch proposed in
<http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00077.html>.)
(usage): Document it.
(copy_on_change): New var.
* tests/defs.in (is_younger): New function.
* tests/instsh2.test: Check install-sh -C.
commit 26ee0fb7d55bf631c91a0d7ca12bbaaeddbb9f1f
Author: Ralf Wildenhues <address@hidden>
Date: Sat Jan 19 09:59:17 2008 +0100
Backport install-sh change from master branch:
2006-12-24 Paul Eggert <address@hidden>
* lib/install-sh: Fix typo in previous patch for handling --.
Use more-consistent style for ';;'.
Prefer || to if-then-else-:.
* tests/install2.test: Rework to avoid set -e problems.
2006-12-24 Akim Demaille <address@hidden>
Simplify install-sh and its test. This shouldn't change any behavior.
(This patch is a subset of the patch proposed in
<http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00077.html>.)
* lib/install-sh (usage): Use usual GNU style.
(dstarg): Rename as...
(dst_arg): this for consistency.
Simplify quoting of assignments.
Sort them.
Don't use '\' to continue commands: && suffices.
Remove useless "continue" in the argument processing,
and factor the shifts.
* tests/defs.in: Some improvements to make it set -e clean.
Use the traditional ":" trick to protect loops from being empty.
Remove an empty straightforward piece of code prepared to define
additional variables.
Use test instead of [], for consistency.
* tests/install2.test: Use set -e, to simplify code.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 60 +++++++++++++
lib/install-sh | 228 +++++++++++++++++++++++++++------------------------
tests/defs.in | 32 ++++++--
tests/install2.test | 24 +++--
tests/instsh2.test | 17 ++++-
5 files changed, 233 insertions(+), 128 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f4e3613..7480120 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,63 @@
+2008-01-19 Ralf Wildenhues <address@hidden>
+
+ Backport from master branch:
+
+ 2006-12-25 Paul Eggert <address@hidden>
+
+ * lib/install-sh (initialize_posix_glob): New var.
+ Use it instead of setting posix_glob inline.
+ (posix_glob): Use '?'/''/: instead of ''/yes/no, for convenience.
+ (cmpprog, CMPPROG): New vars, since we use cmp rather than the diff
+ of Akim's patch.
+ Use LC_ALL before invoking 'ls' when we depend on its output format.
+ Don't use awk; just use the shell's builtin features.
+ Clean up $dsttmp -C detects no installation is needed.
+ * tests/defs.in (is_newest): Renamed from is_younger; the new
+ name is more accurate. All uses changed.
+ (old_timestamp): New var.
+ * tests/instsh2.test: Rewrite to avoid the need for sleeping.
+
+ 2006-12-25 Akim Demaille <address@hidden>
+
+ * lib/install-sh: Implement install-sh -C.
+ (This patch is the remaining part of the patch proposed in
+
<http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00077.html>.)
+ (usage): Document it.
+ (copy_on_change): New var.
+ * tests/defs.in (is_younger): New function.
+ * tests/instsh2.test: Check install-sh -C.
+
+2008-01-19 Ralf Wildenhues <address@hidden>
+
+ Backport from master branch:
+
+ 2006-12-24 Paul Eggert <address@hidden>
+
+ * lib/install-sh: Fix typo in previous patch for handling --.
+ Use more-consistent style for ';;'.
+ Prefer || to if-then-else-:.
+ * tests/install2.test: Rework to avoid set -e problems.
+
+ 2006-12-24 Akim Demaille <address@hidden>
+
+ Simplify install-sh and its test. This shouldn't change any behavior.
+ (This patch is a subset of the patch proposed in
+
<http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00077.html>.)
+ * lib/install-sh (usage): Use usual GNU style.
+ (dstarg): Rename as...
+ (dst_arg): this for consistency.
+ Simplify quoting of assignments.
+ Sort them.
+ Don't use '\' to continue commands: && suffices.
+ Remove useless "continue" in the argument processing,
+ and factor the shifts.
+ * tests/defs.in: Some improvements to make it set -e clean.
+ Use the traditional ":" trick to protect loops from being empty.
+ Remove an empty straightforward piece of code prepared to define
+ additional variables.
+ Use test instead of [], for consistency.
+ * tests/install2.test: Use set -e, to simplify code.
+
2008-01-14 Ralf Wildenhues <address@hidden>
* doc/automake.texi (DESTDIR, Built sources example): Fix wording.
diff --git a/lib/install-sh b/lib/install-sh
index 4fbbae7..a5897de 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-10-14.15
+scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -48,7 +48,7 @@ IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
@@ -58,34 +58,49 @@ fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
-posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
+chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
-chgrpcmd=
-stripcmd=
+mvcmd=$mvprog
rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
src=
dst=
dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
no_target_directory=
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@@ -95,65 +110,55 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification
time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
- -c) shift
- continue;;
+ -c) ;;
+
+ -C) copy_on_change=true;;
- -d) dir_arg=true
- shift
- continue;;
+ -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- shift
- shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
- continue;;
+ shift;;
-o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
+ shift;;
- -s) stripcmd=$stripprog
- shift
- continue;;
+ -s) stripcmd=$stripprog;;
- -t) dstarg=$2
- shift
- shift
- continue;;
+ -t) dst_arg=$2
+ shift;;
- -T) no_target_directory=true
- shift
- continue;;
+ -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
@@ -165,21 +170,22 @@ while test $# -ne 0; do
*) break;;
esac
+ shift
done
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from
address@hidden
for arg
do
- if test -n "$dstarg"; then
+ if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
+ set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
- dstarg=$arg
+ dst_arg=$arg
done
fi
@@ -224,7 +230,7 @@ for src
do
# Protect names starting with `-'.
case $src in
- -*) src=./$src ;;
+ -*) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -242,22 +248,22 @@ do
exit 1
fi
- if test -z "$dstarg"; then
+ if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
- dst=$dstarg
+ dst=$dst_arg
# Protect names starting with `-'.
case $dst in
- -*) dst=./$dst ;;
+ -*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
+ echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
@@ -378,26 +384,19 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix=/ ;;
- -*) prefix=./ ;;
- *) prefix= ;;
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
esac
- case $posix_glob in
- '')
- if (set -f) 2>/dev/null; then
- posix_glob=true
- else
- posix_glob=false
- fi ;;
- esac
+ eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
- $posix_glob && set -f
+ $posix_glob set -f
set fnord $dstdir
shift
- $posix_glob && set +f
+ $posix_glob set +f
IFS=$oIFS
prefixes=
@@ -459,41 +458,54 @@ do
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $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
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- 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 $dst" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- } || exit 1
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $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
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $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 $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
trap '' 0
fi
diff --git a/tests/defs.in b/tests/defs.in
index ca3eb3b..b1bb327 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -50,7 +50,7 @@ if test -z "$srcdir"; then
# compute $srcdir.
srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
test $srcdir = $0 && srcdir=.
-fi
+else :; fi
# Ensure $srcdir is set correctly.
test -f $srcdir/defs.in || {
@@ -285,23 +285,23 @@ case $required in
*libtool* | *gettext* )
aclocaldir='@prefix@/share/aclocal'
extra_includes=""
- if [ -f $aclocaldir/dirlist ] ; then
+ if test -f $aclocaldir/dirlist; then
extra_includes=`(tmp_inc=""
while read LINE ; do
tmp_inc="$tmp_inc -I $LINE"
done
echo $tmp_inc) < $aclocaldir/dirlist`
- fi
+ else :; fi
libtool_found=no
gettext_found=no
for d in $extra_includes $aclocaldir ; do
- [ "x$d" != x-I ] || continue
- if [ -f "$d/libtool.m4" ] ; then
- libtool_found=yes
+ test "x$d" != x-I || continue
+ if test -f "$d/libtool.m4"; then
+ libtool_found=yes
fi
- if [ -f "$d/gettext.m4" ] ; then
- gettext_found=yes
+ if test -f "$d/gettext.m4"; then
+ gettext_found=yes
fi
done
case $required in
@@ -329,6 +329,22 @@ sleep='sleep @MODIFICATION_DELAY@'
testsrcdir=$srcdir
unset srcdir
+# An old timestamp that can be given to a file, in "touch -t" format.
+# The time stamp should be portable to all file systems of interest.
+# Just for fun, choose the exact time of the announcement of the GNU project
+# in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
+old_timestamp=198309271735.59
+
+# is_newest FILE FILES
+# --------------------
+# Return false if any file in FILES is newer than FILE.
+# Resolve ties in favor of FILE.
+is_newest ()
+{
+ test x`find "$@" -newer "$1"` = x
+}
+
+
# AUTOMAKE_run status [options...]
# --------------------------------
# Run Automake with OPTIONS, and fail if automake
diff --git a/tests/install2.test b/tests/install2.test
index c08e108..07c8d77 100755
--- a/tests/install2.test
+++ b/tests/install2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -23,6 +23,7 @@
required=gzip
. ./defs || exit 1
+set -e
cat > configure.in << 'END'
AC_INIT
@@ -36,17 +37,20 @@ cat > Makefile.am << 'END'
SUBDIRS = .
END
-$ACLOCAL || exit 1
-$AUTOCONF || exit 1
-$AUTOMAKE -a || exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
chmod 000 Makefile.am
-# On some systems (like DOS and Windows), files are always readable
-test -r Makefile.am && exit 77
+# On some systems (like DOS and Windows), files are always readable.
+test ! -r Makefile.am || exit 77
-./configure || exit 1
-# `dist' should fail because we can't copy Makefile.am.
-$MAKE dist && exit 1
+./configure
-exit 0
+# `dist' should fail because we can't copy Makefile.am.
+if $MAKE dist; then
+ exit 1
+else
+ exit 0
+fi
diff --git a/tests/instsh2.test b/tests/instsh2.test
index 7a1aa03..806749f 100755
--- a/tests/instsh2.test
+++ b/tests/instsh2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -21,7 +21,6 @@
# Various install-sh checks
. ./defs || exit 1
-
set -e
# Basic errors
@@ -82,6 +81,20 @@ test -f d3/y
./install-sh -T x d3 && exit 1
./install-sh -T x d4// && exit 1
+# Do not change the timestamps when using -C.
+echo foo >file
+./install-sh -C file d1
+TZ=UTC0 touch -t $old_timestamp d1/file
+./install-sh -C file d1
+is_newest file d1/file
+echo foo1 >file
+./install-sh -C file d1
+diff file d1/file
+# Rights must be updated.
+./install-sh -C -m 444 file d1
+test -r d1/file
+test ! -w d1/file
+
# Ensure that install-sh works with names that include spaces
touch 'a b'
mkdir 'x y'
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Automake branch, branch-1-10, updated. Release-1-10-65-g95beb49,
Ralf Wildenhues <=