bug-gnulib
[Top][All Lists]
Advanced

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

proposed patch for bootstrap


From: Bruce Korb
Subject: proposed patch for bootstrap
Date: Tue, 05 Apr 2011 12:19:31 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7

This fixes two things:

1. "gnulib_extra_files" should not be computed before sourcing the
   bootstrap.conf file, unless you intend that overriding build_aux
   forces overriding gnulib_extra_files, too.  I don't think so, so
   I deferred its computation until afterward.

2. I also ran into a problem with auto-sorting of an order-dependent
   file.  Below simply appends a file name if it is not found, leaving
   the original order above the newly inserted entry.  Changed the
   function name, too.

If approved, I'll make it an official patch with two commits and
ChangeLog entries.

Regards, Bruce

diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index f004ad3..659f7c3 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2011-03-03.12; # UTC
+scriptversion=2011-04-05.19; # UTC

 # Bootstrap this package from checked-out sources.

@@ -131,18 +131,6 @@ m4_base=m4
 doc_base=doc
 tests_base=tests

-# Extra files from gnulib, which override files from other sources.
-gnulib_extra_files="
-        $build_aux/install-sh
-        $build_aux/missing
-        $build_aux/mdate-sh
-        $build_aux/texinfo.tex
-        $build_aux/depcomp
-        $build_aux/config.guess
-        $build_aux/config.sub
-        doc/INSTALL
-"
-
 # Additional gnulib-tool options to use.  Use "\newline" to break lines.
 gnulib_tool_option_extras=

@@ -229,6 +217,18 @@ case "$0" in
   *) test -r "$0.conf" && . ./"$0.conf" ;;
 esac

+# Extra files from gnulib, which override files from other sources.
+test -z "${gnulib_extra_files}" && \
+  gnulib_extra_files="
+        $build_aux/install-sh
+        $build_aux/missing
+        $build_aux/mdate-sh
+        $build_aux/texinfo.tex
+        $build_aux/depcomp
+        $build_aux/config.guess
+        $build_aux/config.sub
+        doc/INSTALL
+"

 if test "$vc_ignore" = auto; then
   vc_ignore=
@@ -280,17 +280,18 @@ if test -n "$checkout_only_file" && test ! -r 
"$checkout_only_file"; then
   exit 1
 fi

-# If $STR is not already on a line by itself in $FILE, insert it,
-# sorting the new contents of the file and replacing $FILE with the result.
-insert_sorted_if_absent() {
+# If $STR is not already on a line by itself in $FILE, append it.
+insert_if_absent() {
   file=$1
   str=$2
   test -f $file || touch $file
-  echo "$str" | sort -u - $file | cmp - $file > /dev/null \
-    || echo "$str" | sort -u - $file -o $file \
-    || exit 1
+  grep_res=`grep "^${str}\$" $file` 2>/dev/null
+  test -z "${grep_res}" && {
+    echo "$str" >> $file || exit 1
+  }
 }

 # Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
-# insert_sorted_if_absent.
+# insert_if_absent.
 insert_vc_ignore() {
   vc_ignore_file="$1"
   pattern="$2"
@@ -301,7 +301,7 @@ insert_vc_ignore() {
     # .gitignore entry.
     pattern=`echo "$pattern" | sed s,^,/,`;;
   esac
-  insert_sorted_if_absent "$vc_ignore_file" "$pattern"
+  insert_if_absent "$vc_ignore_file" "$pattern"
 }

 # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.



reply via email to

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