[Top][All Lists]

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

Re: install-sh -C

From: Akim Demaille
Subject: Re: install-sh -C
Date: Sun, 22 Oct 2006 19:10:20 +0200

I think using \ then newline then && was done to mimic GCS style for C
code.  FWIW, I prefer your style as well.

That style was also used elsewhere.

Wouldn't using $diffprog without double quotes be more consistent,
so the user could pass options to diff as well?


+        test x"`ls -l \"$dsttmp\" | awk '{print $1\":\"$3 \":\"$4}'`" = \
+             x"`ls -l \"$dst\"    | awk '{print $1\":\"$3 \":\"$4}'`"

This is not portable: "...`...\"...\"...`...".  Write like this:
  new=`ls -l "$dsttmp" | awk '{print $1":"$3 ":"$4}'`
  old=`ls -l "$dst"    | awk '{print $1":"$3 ":"$4}'`
  test x"$old" = x"$new"


how can I have forgotten this :)  Thanks.

+      then
+       # No need to copy, that's the same file.
+       continue
+      else :; fi } &&

There has to be a semicolon before the }, I think.

I don't you do: I think the semi-colon is required to end the command
just as you would after a "test" before the "then".  But here, it's
a shell syntactic construct, not an "open" command.

Anyway, I don't think it can harm, so I added it.

+# youngest_file FILES
+# -------------------
+# Return the youngest member of FILES.
+youngest_file ()
+  ls -1t "$@" | sed 1q
+# is_younger FILE FILES
+# ---------------------
+# Check that FILE is younger than all the FILES.
+is_younger ()
+  test `youngest_file "$@"` = "$1"
+  return $?

I have some problems with these definitions. If there are several files that have the youngest time stamp, then the order depends on the locale.

Nia?  How can the locale change the order to time stamps?  Anyway, here
if there are several "youngest", then something is wrong.  That trick is
used in many places, including Automake's tests.

Yuck. Stepan suggested `find -newer' as one way out in the case we ran
into this, I think.

I fail to see why it would solve anything: why should find avoid
nondeterminism due to equality of time stamps?

Otherwise there need to be even more "$sleep"s in the test suite over
the time, and they already slow it down noticeably.

Really?  Where should I add some?

Here is the patch, updated, thanks!

Attachment: diffs.patch
Description: Binary data

reply via email to

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