[Top][All Lists]

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

[Findutils-patches] speed up gnulib updates

From: Eric Blake-1
Subject: [Findutils-patches] speed up gnulib updates
Date: Thu, 28 Jun 2007 08:49:13 -0700 (PDT)

Currently, rerunning 'sh ./' is slower than necessary,
because it unconditionally wipes away any previous gnulib subdir.
gnulib-tool is now smart enough to cope with the changes (added
files, changed files, and deleted files), so that reusing the existing
directory slightly speeds up this operation; additionally, on an
in-tree build, compilation results are not lost, which further speeds
development.  The only bug that gnulib-tool still has is that when
using the --symlink option, it can leave behind dangling symlinks
when files are deleted from gnulib (I guess I should raise that as
a bug on the gnulib list).

OK to apply to branch and head?

Two other issues discovered during this patch:
James, do you have write access to the savannah CVS repository,
to do 'chmod +x,v', or do I need to get Jim
Meyering to do that?  It's annoying to have to do
'sh ./'.

Also, 'man find' is a bit misleading.  Under -L, it states "Using -L
causes the -lname and -ilname predicates always to return
false."  But in reality, -lname is correct in documenting that "If
the -L option or the -follow option is in effect, this test returns
false unless the symbolic link is broken."  Hence a very easy
way to find and nuke leftover broken symlinks.

2007-06-28  Eric Blake  <address@hidden>

        * (usage): Speed operation when updating an
        existing tree.
        * import-gnulib.config (modules): Sort, remove strstr since it is
        no longer a gnulib module.

Index: import-gnulib.config
RCS file: /sources/findutils/findutils/import-gnulib.config,v
retrieving revision
diff -u -p -b -r1.1.2.2 import-gnulib.config
--- import-gnulib.config        22 Apr 2007 15:43:04 -0000
+++ import-gnulib.config        28 Jun 2007 15:44:50 -0000
@@ -1,3 +1,5 @@
+# findutils import-gnulib.config -*- sh -*-
 # What version of gnulib to use?
 # To late: gnulib_version="2005-07-30"
 # ?Too early gnulib_version="2005-07-10"
@@ -30,11 +32,47 @@ build-aux/texinfo.tex
 # Modules needed for findutils.
 # We need regex to ensure that we can build on platforms like
 # Solaris which lack those functions.
-alloca  argmatch  dirname error fileblocks fnmatch-gnu fopen-safer \
-getline getopt human idcache lstat malloc memcmp memset mktime \
-modechange pathmax quotearg realloc regex rpmatch savedir \
-stpcpy strdup strftime  strstr strtol strtoul strtoull strtoumax  \
-xalloc xalloc-die xgetcwd  xstrtol  xstrtoumax yesno human filemode \
-getline stpcpy canonicalize mountlist closeout gettext stat-macros"
RCS file: /sources/findutils/findutils/,v
retrieving revision
diff -u -p -b -r1.21.4.3
---    22 Apr 2007 15:54:38 -0000
+++    28 Jun 2007 15:44:50 -0000
@@ -129,10 +129,10 @@ run_gnulib_tool() {
     if [ -d gnulib ]
-        echo "Warning: directory gnulib already exists, removing it." >&2
-        rm -rf gnulib
-    fi
+       echo "Warning: directory gnulib already exists." >&2
+    else
     mkdir gnulib
+    fi
     set -x
     if "$tool" --import --symlink --with-tests --dir=. --lib=libgnulib
--source-base=gnulib/lib --m4-base=gnulib/m4  $modules
@@ -143,6 +143,10 @@ run_gnulib_tool() {
         echo "$tool failed, exiting." >&2
         exit 1
+    # gnulib-tool does not remove broken symlinks leftover from previous
+    # this assumes GNU find, but should be a safe no-op if it is not
+    find -L gnulib -lname '*' -delete 2>/dev/null || :

View this message in context:
Sent from the GNU - FindUtils - Patches mailing list archive at

reply via email to

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