[Top][All Lists]

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

bootstrap symlink dependencies

From: Pádraig Brady
Subject: bootstrap symlink dependencies
Date: Mon, 09 May 2011 11:05:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100227 Thunderbird/3.0.3

I've noticed a few times when re-running bootstrap
within my coreutils directory, that the build will fail because
it seems that the timestamps of the symlinks in m4/ are used,
rather than those of the target m4 files.

For example recently, @HAVE_SIGHANDLER_T@ was left unsubstituted in
lib/signal.h. To workaround this I just removed the m4/signal_h.m4 symlink
and re-ran bootstrap.

Now it seems like honoring the symlink timestamp might be on purpose,
since it's a little more awkward to do that, and also I notice
that bootstrap goes to some efforts to maintain symlink timestamps.

If symlink timestamps shouldn't matter, then the following should work.
Note it doesn't seem to change my build time after a bootstrap here.
Note also it updates symlinks in lib/*.[ch] too.
Also, this would also suggest that whatever is adding significance
to the symlink timetamps should be fixed too.

diff --git a/bootstrap b/bootstrap
index c45ae48..5ac7f25 100755
--- a/bootstrap
+++ b/bootstrap
@@ -643,10 +643,8 @@ symlink_to_dir()
         cp -fp "$src" "$dst"
-      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" || {
+      rm -f "$dst"
+      {
         case $src in
         /*) ;;

If we did want to maintain the symlink timestamps for some reason,
then I suppose we could do something like the following,
but I'm unsure as how to do this best portably.

diff --git a/bootstrap b/bootstrap
index c45ae48..c72d792 100755
--- a/bootstrap
+++ b/bootstrap
@@ -646,6 +646,7 @@ symlink_to_dir()
       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 `stat -c %Y "$dst"` -ge `stat -c %Y "$src"` &&
       test "$src_i" = "$dst_i" || {
         case $src in


reply via email to

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