bug-gnulib
[Top][All Lists]
Advanced

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

Re: bootstrap symlink dependencies


From: Jim Meyering
Subject: Re: bootstrap symlink dependencies
Date: Mon, 16 May 2011 20:57:46 +0200

Paul Eggert wrote:
> On 05/16/11 07:44, Pádraig Brady wrote:
>> I tested your ls ordering trick on linux, solaris 10 and freebsd and it 
>> works.
>> Please push.
>
> Thanks, done.

Thanks.  I appreciate the added comments, too ;-)

What do you think of this addition?
It may be more efficient to invoke one subshell rather than two,
even though the new subshell includes an additional pipe to sed.
For the record, I don't really care either way, since even for coreutils,
saving 1000 subshells (one per file from gnulib) is probably a
negligible gain in performance, overall.


>From 505269035674871320926a2aac4c7091d6267aa4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 15 May 2011 09:24:40 +0200
Subject: [PATCH] bootstrap: performance tweak: use one fewer subshell per
 file

* build-aux/bootstrap (symlink_to_dir): Use one subshell rather than
two in determining whether two files refer to the same inode number.
---
 ChangeLog           |    6 ++++++
 build-aux/bootstrap |    7 +++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dc66282..f3c1561 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-15  Jim Meyering  <address@hidden>
+
+       bootstrap: performance tweak: use one fewer subshell per file
+       * build-aux/bootstrap (symlink_to_dir): Use one subshell rather
+       than two in determining whether two file's inode numbers are the same.
+
 2011-05-13  Jim Meyering  <address@hidden>

        maint.mk: three new prohibit_<HDR>_without_use rules
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 522ac70..f8f1975 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2011-05-16.16; # UTC
+scriptversion=2011-05-16.18; # UTC

 # Bootstrap this package from checked-out sources.

@@ -677,9 +677,8 @@ symlink_to_dir()
       # so that broken tools aren't confused into skipping needed builds.  See
       # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
       test -h "$dst" &&
-      src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
-      dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
-      test "$src_i" = "$dst_i" &&
+      inums=`ls -1diL "$src" "$dst" 2>/dev/null|sed 's/ .*//'` && set $inums &&
+      test "$1" = "$2" &&
       both_ls=`ls -dt "$src" "$dst"` &&
       test "X$both_ls" = "X$dst$nl$src" || {
         dot_dots=
--
1.7.5.1.467.g1a85



reply via email to

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