[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ``install -C'' / unnecessarily updating time stamps
From: |
Ralf Wildenhues |
Subject: |
Re: ``install -C'' / unnecessarily updating time stamps |
Date: |
Tue, 9 Jan 2007 21:44:03 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hello Paul,
This continues
<http://lists.gnu.org/archive/html/automake-patches/2006-12/msg00019.html>.
First, a big thank you for finishing up the work Akim started on this.
* Paul Eggert wrote on Tue, Dec 26, 2006 at 06:23:15AM CET:
[...]
> --- tests/defs.in 25 Dec 2006 06:30:28 -0000 1.40
> +++ tests/defs.in 26 Dec 2006 05:20:50 -0000
[...]
> +# 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
> +}
This breaks (outputs an ugly `test: too many arguments' error, or,
depending on file names, does weird things) when the find returns more
than one younger file. Which can't happen with its current usage, but
surely contradicts the documentation.
OK to apply?
Cheers,
Ralf
2007-01-09 Ralf Wildenhues <address@hidden>
* tests/defs.in (is_newest): Cope with multiple newer files.
* NEWS: mention `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 9 Jan 2007 20:42:57 -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: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.41
diff -u -r1.41 defs.in
--- tests/defs.in 26 Dec 2006 05:20:52 -0000 1.41
+++ tests/defs.in 9 Jan 2007 20:42:57 -0000
@@ -2,7 +2,7 @@
# @configure_input@
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -328,7 +328,8 @@
# Resolve ties in favor of FILE.
is_newest ()
{
- test x`find "$@" -newer "$1"` = x
+ is_newest_files=`find "$@" -newer "$1"`
+ test -z "$is_newest_files"
}
- Re: ``install -C'' / unnecessarily updating time stamps,
Ralf Wildenhues <=