findutils-patches
[Top][All Lists]
Advanced

[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 ./import-gnulib.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 import-gnulib.sh,v', or do I need to get Jim
Meyering to do that?  It's annoying to have to do
'sh ./import-gnulib.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>

        * import-gnulib.sh (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 1.1.2.2
diff -u -p -b -r1.1.2.2 import-gnulib.config
--- import-gnulib.config        22 Apr 2007 15:43:04 -0000      1.1.2.2
+++ 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.
-modules="\
-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"
-
+modules='
+alloca
+argmatch
+canonicalize
+closeout
+dirname
+error
+fileblocks
+filemode
+fnmatch-gnu
+fopen-safer
+getline
+getopt
+gettext
+human
+idcache
+lstat
+malloc
+memcmp
+memset
+mktime
+modechange
+mountlist
+pathmax
+quotearg
+realloc
+regex
+rpmatch
+savedir
+stat-macros
+stpcpy
+strdup
+strftime
+strtol
+strtoul
+strtoull
+strtoumax
+xalloc
+xalloc-die
+xgetcwd
+xstrtol
+xstrtoumax
+yesno
+'
Index: import-gnulib.sh
===================================================================
RCS file: /sources/findutils/findutils/import-gnulib.sh,v
retrieving revision 1.21.4.3
diff -u -p -b -r1.21.4.3 import-gnulib.sh
--- import-gnulib.sh    22 Apr 2007 15:54:38 -0000      1.21.4.3
+++ import-gnulib.sh    28 Jun 2007 15:44:50 -0000
@@ -129,10 +129,10 @@ run_gnulib_tool() {
     
     if [ -d gnulib ]
     then
-        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
     fi
+
+    # gnulib-tool does not remove broken symlinks leftover from previous
runs;
+    # 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: 
http://www.nabble.com/speed-up-gnulib-updates-tf3995128.html#a11345701
Sent from the GNU - FindUtils - Patches mailing list archive at Nabble.com.





reply via email to

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