Certainly. But frequently in Automake tests the problem is as
follows:
do_something with $file
$sleep
touch stampfile
do_something_else with $file
ensure that $file is updated/not updated.
If the last command is done with `ls -1t', I either have to think
about
the locale ordering in case that do_something_else finishes quickly
(i.e., in less than a second; even if it doesn't now, it will in a
couple of years). Or I have to add another $sleep after the touch.
Or I use
find stampfile -newer $file
which ensures me that $file is at least as new as stampfile.
OK, so I finally understand: you are ok with working with
"newer or as older", while I'm stating that using find or
ls is just the same when you are interested in "strictly
newer". It is our usage that differs.
Hum. Actually, are you sure "-newer" means what you claim?
"ensures me that $file is at least as new as stampfile" while
it seems to mean that it is strictly newer than stampfile.
At least on OSX:
-newer file
True if the current file has a more recent last
modification time
than file.
[EMAIL PROTECTED] $ touch foo bar
[EMAIL PROTECTED] $ find foo -newer bar
[EMAIL PROTECTED] $ find bar -newer foo
[EMAIL PROTECTED] $ find . -newer foo
[EMAIL PROTECTED] $ find . -newer bar
[EMAIL PROTECTED] $
I used it in the attached patch.
Interresting thread (congratulations Sherlock!), but again, I fail to
see any added value to find compared to ls. If the result is
undefined
because the time stamps are too close (read equal), then I don't care
about determinism.
So you prefer to add another $sleep in the above scenario.
Absolutely.
+set -e
required=gzip
-. ./defs || exit 1
+. ./defs
I don't think `defs' is written to be `set -e' clean. At least all
other tests only enable it after sourcing defs.
Agreed, but what do you suggest: proofreading defs so that it'd
be, or do as in the other tests?
Do as in the other tests. You could also proofread, if you like.
But it will be a bit ugly. For example you will have to write
| if test -n "$required"
| then
[...]
| if ( bison --version ); then :; else exit 77; fi
instead of
| ( bison --version ) || exit 77
because of the OpenBSD /bin/sh bug with `set -e' that is described in
http://www.gnu.org/software/autoconf/manual/html_node/Limitations-
of-Builtins.html#index-g_t_0040command_007bset_007d-1240
Gee! That's a new one :( I know that
false && echo
is not safe with -e (and actually, it does seem fair), but I did not
know
false || echo
could be a problem. BTW, the example in the Autoconf doc would
be much clearer (IMHO) with true and false instead of test.
I prefer the former, that's more factorized.
Factored! Shame on me :(
I have some qualms about the Bourne compatibility initialization,
and whether it can be made `set -e'-clean. I saw weird issues with
AIX /bin/sh in Libtool, but have not been able to get to the bottom
of those yet. (I've been meaning to do that in order to be able to
write a helpful bug report to Autoconf.)
But working without -e is so dangerous too...
Here is my updated proposal.
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
Implement install-sh -C.
* lib/install-sh ($usage): Complete.
Indent.
($dstarg): Rename as...
($dst_arg): this for consistency.
($copy_on_change, $diffprog): New variables.
Simplify quoting of assignments.
Sort them.
Don't use '\' to continue commands: && suffices.
Implement -C.
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.
(is_younger): New.
* tests/install2.test: Use set -e.
* tests/instsh2.test: Check install-sh -C.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.322
diff -u -r1.322 NEWS
--- NEWS 16 Oct 2006 05:24:17 -0000 1.322
+++ NEWS 25 Oct 2006 15:34:49 -0000
@@ -11,6 +11,10 @@
* Miscellaneous changes:
- New shorthand `$(pkglibexecdir)' for `$(libexecdir)/@PACKAGE@'.
+
+ - install-sh supports -C, which does not update the installed file
+ (and its time stamps) if the contents did not change.
+
New in 1.10:
Index: lib/install-sh
===================================================================
RCS file: /cvs/automake/automake/lib/install-sh,v
retrieving revision 1.37
diff -u -r1.37 install-sh
--- lib/install-sh 14 Oct 2006 13:37:32 -0000 1.37
+++ lib/install-sh 25 Oct 2006 15:34:50 -0000
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-10-14.15
+scriptversion=2006-10-22.10
# 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 @@
# 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,14 +58,15 @@
# 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}
+cpprog=${CPPROG-cp}
+diffprog=${DIFFPROG-diff}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
posix_glob=
posix_mkdir=
@@ -73,19 +74,23 @@
# 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,91 +100,85 @@
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 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 CPPROG DIFFPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
- -c) shift
- continue;;
+ -c) ;;
- -d) dir_arg=true
- shift
- continue;;
+ -C) copy_on_change=true;;
+
+ -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;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
shift
- shift
- continue;;
+ ;;
+
+ -s) stripcmd=$stripprog;;
- -T) no_target_directory=true
+ -t) dst_arg=$2
shift
- continue;;
+ ;;
+
+ -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) ;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) 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 [EMAIL
PROTECTED]
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
@@ -242,12 +241,12 @@
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 ;;
@@ -257,7 +256,7 @@
# 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
@@ -384,7 +383,7 @@
esac
case $posix_glob in
- '')
+ '')
if (set -f) 2>/dev/null; then
posix_glob=true
else
@@ -459,10 +458,22 @@
# 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"; } &&
+ { 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"; } &&
+
+ # Maybe we don't need to install the file. Use diff, not cmp,
+ # to be robust to end-of-line encoding.
+ { if $copy_on_change &&
+ $diffprog "$dsttmp" "$dst" >/dev/null 2>&1 &&
+ new=`ls -l "$dsttmp" | awk '{print $1 ":" $3 ":" $4}'` &&
+ old=`ls -l "$dst" | awk '{print $1 ":" $3 ":" $4}'` &&
+ test x"$new" = x"$old"
+ then
+ # No need to copy, that's the same file.
+ continue
+ else :; fi; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.39
diff -u -r1.39 defs.in
--- tests/defs.in 6 Jul 2006 18:13:01 -0000 1.39
+++ tests/defs.in 25 Oct 2006 15:34:52 -0000
@@ -50,7 +50,7 @@
# 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 || {
@@ -97,131 +97,125 @@
# (See note about `export' in the Autoconf manual.)
export PATH
-if test -n "$required"
-then
- for tool in $required
- do
- # Check that each required tool is present.
- case $tool in
- bison)
- # Since bison is required, we pick YACC for ./configure.
- YACC='bison -y'
- export YACC
- echo "$me: running bison --version"
- ( bison --version ) || exit 77
- ;;
- bzip2)
- # Do not use --version, bzip2 still tries to compress stdin.
- echo "$me: running bzip2 --help"
- ( bzip2 --help ) || exit 77
- ;;
- etags)
- # Exuberant Ctags will create a TAGS file even
- # when asked for --help or --version. (Emacs's etags
- # does not have such problem.) Use -o /dev/null
- # to make sure we do not pollute the tests/ directory.
- echo "$me: running etags --version -o /dev/null"
- ( etags --version -o /dev/null ) || exit 77
- ;;
- GNUmake)
- # Use --version AND -v, because SGI Make doesn't fail on --version.
- # Also grep for GNU because newer versions of FreeBSD make do
- # not complain about `--version' (they seem to silently ignore it).
- echo "$me: running $MAKE --version -v | grep GNU"
- ( $MAKE --version -v | grep GNU ) || exit 77
- ;;
- gcc)
- # When gcc is required, export `CC=gcc' so that ./configure
- # always use it. This is important only when the user
- # has defined CC in his environment, otherwise ./configure will
- # prefer gcc to other compilers.
- CC=gcc
- export CC
- echo "$me: running $CC --version"
- ( $CC --version ) || exit 77
- ;;
- g++)
- CXX=g++
- export CXX
- echo "$me: running $CXX --version"
- ( $CXX --version ) || exit 77
- ;;
- icc)
- CC=icc
- export CC
- # There is no way to ask *only* the compiler's version.
- # This tool always want to do something (by default
- # it will try link *nothing* and complain it cannot find
- # main(); funny). Use -help so it does not try linking anything.
- echo "$me: running $CC -V -help"
- ( $CC -V -help ) || exit 77
- ;;
- makedepend)
- echo "$me: running makedepend -f-"
- ( makedepend -f- ) || exit 77
- ;;
- makeinfo-html)
- # Make sure makeinfo understands --html.
- echo "$me: running makeinfo --html --version"
- ( makeinfo --html --version ) || exit 77
- ;;
- non-root)
- # Skip this test case if the user is root.
- # We try to append to a read-only file to detect this.
- priv_check_temp=priv-check.$$
- touch $priv_check_temp || exit 1
- chmod a-w $priv_check_temp || exit 1
- (echo foo >> $priv_check_temp) >/dev/null 2>&1
- overwrite_status=$?
- rm -f $priv_check_temp
- test $overwrite_status = 0 && exit 77
- ;;
- python)
- # Python doesn't support --version, it has -V
- echo "$me: running python -V"
- ( python -V ) || exit 77
- ;;
- ro-dir)
- # Skip this test case if read-only directories aren't supported
- # (e.g., under DOS.)
- ro_dir_temp=ro_dir.$$
- mkdir $ro_dir_temp || exit 1
- chmod a-w $ro_dir_temp || exit 1
- (: > $ro_dir_temp/probe) >/dev/null 2>/dev/null
- create_status=$?
- rm -rf $ro_dir_temp
- test $create_status = 0 && exit 77
- ;;
- runtest)
- # DejaGnu's runtest program. We rely on being able to specify
- # the program on the runtest command-line. This requires
- # DejaGnu 1.4.3 or later.
- echo "$me: running runtest --version"
- (runtest SOMEPROGRAM=someprogram --version) || exit 77
- ;;
- tex)
- # No all versions of Tex support `--version', so we use
- # a configure check.
- test -n "@TEX@" || exit 77
- ;;
- texi2dvi-o)
- # Texi2dvi supports `-o' since Texinfo 4.1.
- echo "$me: running texi2dvi -o /dev/null --version"
- ( texi2dvi -o /dev/null --version ) || exit 77
- ;;
- # Generic case: the tool must support --version.
- *)
- echo "$me: running $tool --version"
- ( $tool --version ) || exit 77
- ;;
- esac
- # Additional variables to define if some $tool is required.
- case $tool in
- gcc)
- ;;
- esac
- done
-fi
+for tool in : $required
+do
+ # Check that each required tool is present.
+ case $tool in
+ :) ;;
+ bison)
+ # Since bison is required, we pick YACC for ./configure.
+ YACC='bison -y'
+ export YACC
+ echo "$me: running bison --version"
+ ( bison --version ) || exit 77
+ ;;
+ bzip2)
+ # Do not use --version, bzip2 still tries to compress stdin.
+ echo "$me: running bzip2 --help"
+ ( bzip2 --help ) || exit 77
+ ;;
+ etags)
+ # Exuberant Ctags will create a TAGS file even
+ # when asked for --help or --version. (Emacs's etags
+ # does not have such problem.) Use -o /dev/null
+ # to make sure we do not pollute the tests/ directory.
+ echo "$me: running etags --version -o /dev/null"
+ ( etags --version -o /dev/null ) || exit 77
+ ;;
+ GNUmake)
+ # Use --version AND -v, because SGI Make doesn't fail on --version.
+ # Also grep for GNU because newer versions of FreeBSD make do
+ # not complain about `--version' (they seem to silently ignore it).
+ echo "$me: running $MAKE --version -v | grep GNU"
+ ( $MAKE --version -v | grep GNU ) || exit 77
+ ;;
+ gcc)
+ # When gcc is required, export `CC=gcc' so that ./configure
+ # always use it. This is important only when the user
+ # has defined CC in his environment, otherwise ./configure will
+ # prefer gcc to other compilers.
+ CC=gcc
+ export CC
+ echo "$me: running $CC --version"
+ ( $CC --version ) || exit 77
+ ;;
+ g++)
+ CXX=g++
+ export CXX
+ echo "$me: running $CXX --version"
+ ( $CXX --version ) || exit 77
+ ;;
+ icc)
+ CC=icc
+ export CC
+ # There is no way to ask *only* the compiler's version.
+ # This tool always want to do something (by default
+ # it will try link *nothing* and complain it cannot find
+ # main(); funny). Use -help so it does not try linking anything.
+ echo "$me: running $CC -V -help"
+ ( $CC -V -help ) || exit 77
+ ;;
+ makedepend)
+ echo "$me: running makedepend -f-"
+ ( makedepend -f- ) || exit 77
+ ;;
+ makeinfo-html)
+ # Make sure makeinfo understands --html.
+ echo "$me: running makeinfo --html --version"
+ ( makeinfo --html --version ) || exit 77
+ ;;
+ non-root)
+ # Skip this test case if the user is root.
+ # We try to append to a read-only file to detect this.
+ priv_check_temp=priv-check.$$
+ touch $priv_check_temp || exit 1
+ chmod a-w $priv_check_temp || exit 1
+ (echo foo >> $priv_check_temp) >/dev/null 2>&1
+ overwrite_status=$?
+ rm -f $priv_check_temp
+ test $overwrite_status = 0 && exit 77
+ ;;
+ python)
+ # Python doesn't support --version, it has -V
+ echo "$me: running python -V"
+ ( python -V ) || exit 77
+ ;;
+ ro-dir)
+ # Skip this test case if read-only directories aren't supported
+ # (e.g., under DOS.)
+ ro_dir_temp=ro_dir.$$
+ mkdir $ro_dir_temp || exit 1
+ chmod a-w $ro_dir_temp || exit 1
+ (: > $ro_dir_temp/probe) >/dev/null 2>/dev/null
+ create_status=$?
+ rm -rf $ro_dir_temp
+ test $create_status = 0 && exit 77
+ ;;
+ runtest)
+ # DejaGnu's runtest program. We rely on being able to specify
+ # the program on the runtest command-line. This requires
+ # DejaGnu 1.4.3 or later.
+ echo "$me: running runtest --version"
+ (runtest SOMEPROGRAM=someprogram --version) || exit 77
+ ;;
+ tex)
+ # No all versions of Tex support `--version', so we use
+ # a configure check.
+ test -n "@TEX@" || exit 77
+ ;;
+ texi2dvi-o)
+ # Texi2dvi supports `-o' since Texinfo 4.1.
+ echo "$me: running texi2dvi -o /dev/null --version"
+ ( texi2dvi -o /dev/null --version ) || exit 77
+ ;;
+ # Generic case: the tool must support --version.
+ *)
+ echo "$me: running $tool --version"
+ ( $tool --version ) || exit 77
+ ;;
+ esac
+done
+
# Always use an absolute srcdir. Otherwise symlinks made in subdirs
# of the test dir just won't work.
@@ -278,23 +272,23 @@
*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
@@ -322,6 +316,16 @@
testsrcdir=$srcdir
unset srcdir
+# is_younger FILE FILES
+# ---------------------
+# Check that FILE is younger than all the FILES.
+is_younger ()
+{
+ test x`find "$@" -newer "$1"` = x
+ return $?
+}
+
+
# AUTOMAKE_run status [options...]
# --------------------------------
# Run Automake with OPTIONS, and fail if automake
Index: tests/install2.test
===================================================================
RCS file: /cvs/automake/automake/tests/install2.test,v
retrieving revision 1.14
diff -u -r1.14 install2.test
--- tests/install2.test 14 May 2005 20:28:55 -0000 1.14
+++ tests/install2.test 25 Oct 2006 15:34:52 -0000
@@ -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,17 @@
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
+# On some systems (like DOS and Windows), files are always readable.
test -r Makefile.am && exit 77
-./configure || exit 1
+./configure
# `dist' should fail because we can't copy Makefile.am.
-$MAKE dist && exit 1
+$MAKE dist && exit 1
exit 0
Index: tests/instsh2.test
===================================================================
RCS file: /cvs/automake/automake/tests/instsh2.test,v
retrieving revision 1.7
diff -u -r1.7 instsh2.test
--- tests/instsh2.test 14 May 2005 20:28:55 -0000 1.7
+++ tests/instsh2.test 25 Oct 2006 15:34:52 -0000
@@ -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 @@
./install-sh -T x d3 && exit 1
./install-sh -T x d4// && exit 1
+# Do not change the timestamps when using -C.
+date >date
+./install-sh -C date d1
+$sleep
+touch date
+./install-sh -C date d1
+is_younger date d1/date
+date >date
+./install-sh -C date d1
+diff date d1/date
+# Rights must be updated.
+./install-sh -C -m 777 date d1
+test -x d1/date
+
# Ensure that install-sh works with names that include spaces
touch 'a b'
mkdir 'x y'