automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ``install -C'' / unnecessarily updating time stamps


From: Thomas Schwinge
Subject: Re: ``install -C'' / unnecessarily updating time stamps
Date: Mon, 25 Dec 2006 11:46:45 +0100
User-agent: Mutt/1.5.11

[I added the patch's author, Akim Demaille, to the cc list, as it was not
sure if he's still reading the list.]


Hello!

On Sun, Dec 24, 2006 at 04:21:50PM -0800, Paul Eggert wrote:
> Benoit Sigoure <address@hidden> writes:
> > http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00070.html
> 
> Sorry, I missed that one.  The idea looks reasonable, but that solves
> the problem for install-sh only, right?  GNU 'install' still wouldn't
> support -C.

This brings up the following question: if `-C' shall be used a) by
default in Autoconf's `AC_PROG_INSTALL' if available or b) if requested
by the programmer through setting some flag, and `install-sh' supports
`-C', but the system's `install' executable doesn't (which will, as far
as I can tell, be the case on most systems as after this quoted patch has
been applied to `install-sh'), which of the two installation programs
shall be chosen: the native `install' for speed or `install-sh' for
feature completeness and to accommodate the programmer's request?


> Also, the updated patch proposed in
> <http://lists.gnu.org/archive/html/automake-patches/2006-10/msg00077.html>
> has some coding-style components along with the substance components.
> I plan to split it into two and apply the two pieces.

| +    # 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; } &&

Is this ``ls -l [...] | awk [...]'' portable enough and is it really
needed?

| http://www.freebsd.org/cgi/man.cgi?query=install
| #v+
| [...]
|      -C      Copy the file.  If the target file already exists and the files
|              are the same, then do not change the modification time of the
|              target.  If the target's file flags and mode need not to be
|              changed, the target's inode change time is also unchanged.
| [...]
| #v-


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]