coreutils
[Top][All Lists]
Advanced

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

[PATCH] build: update to latest gnulib


From: Pádraig Brady
Subject: [PATCH] build: update to latest gnulib
Date: Tue, 30 Dec 2014 02:25:49 +0000

Included in this are gnulib changes 3ea43e02 2768ceb7
which make the device IDs from /proc/self/mountinfo
available to df.  This can be leveraged by a subsequent
change to df to present a more accurate list of file systems.

* bootstrap: Merge from gnulib.
* src/ls.c (dev_ino_pop): s/obstack_blank/obstack_blank_fast/
as this API/ABI has changed, giving memory exhausted errors
if negative (large positive) numbers are passed to obstack_blank().
* tests/df/skip-duplicates.sh: Adjust as the new gnulib code
requires a non NULL mnt_opts even when mnt_type is not "none".
---
 bootstrap                   | 40 +++++++++++++++++++++++++++++++++-------
 gnulib                      |  2 +-
 src/ls.c                    |  2 +-
 tests/df/skip-duplicates.sh |  2 ++
 4 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/bootstrap b/bootstrap
index a3e68f0..1f4c97b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2013-12-05.23; # UTC
+scriptversion=2014-12-08.12; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -42,6 +42,9 @@ export LC_ALL
 
 local_gl_dir=gl
 
+# Honour $PERL, but work even if there is none
+PERL="${PERL-perl}"
+
 me=$0
 
 usage() {
@@ -210,7 +213,17 @@ bootstrap_sync=false
 use_git=true
 
 check_exists() {
+  if test "$1" = "--verbose"; then
+    ($2 --version </dev/null) >/dev/null 2>&1
+    if test $? -ge 126; then
+      # If not found, run with diagnostics as one may be
+      # presented with env variables to set to find the right version
+      ($2 --version </dev/null)
+    fi
+  else
   ($1 --version </dev/null) >/dev/null 2>&1
+  fi
+
   test $? -lt 126
 }
 
@@ -408,7 +421,7 @@ sort_ver() { # sort -V is not generally available
 get_version() {
   app=$1
 
-  $app --version >/dev/null 2>&1 || return 1
+  $app --version >/dev/null 2>&1 || { $app --version; return 1; }
 
   $app --version 2>&1 |
   sed -n '# Move version to start of line.
@@ -446,6 +459,7 @@ check_versions() {
     test "$appvar" = TAR && appvar=AMTAR
     case $appvar in
         GZIP) ;; # Do not use $GZIP:  it contains gzip options.
+        PERL::*) ;; # Keep perl modules as-is
         *) eval "app=\${$appvar-$app}" ;;
     esac
 
@@ -463,11 +477,22 @@ check_versions() {
           ret=1
           continue
         } ;;
+      # Another check is for perl modules.  These can be written as
+      # e.g. perl::XML::XPath in case of XML::XPath module, etc.
+      perl::*)
+        # Extract module name
+        app="${app#perl::}"
+        if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
+          warn_ "Error: perl module '$app' not found"
+          ret=1
+        fi
+        continue
+        ;;
     esac
     if [ "$req_ver" = "-" ]; then
       # Merely require app to exist; not all prereq apps are well-behaved
       # so we have to rely on $? rather than get_version.
-      if ! check_exists $app; then
+      if ! check_exists --verbose $app; then
         warn_ "Error: '$app' not found"
         ret=1
       fi
@@ -598,8 +623,8 @@ case ${GNULIB_SRCDIR--} in
   # Note that $use_git is necessarily true in this case.
   if git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
-    git submodule init || exit $?
-    git submodule update || exit $?
+    git submodule init -- "$gnulib_path" || exit $?
+    git submodule update -- "$gnulib_path" || exit $?
 
   elif [ ! -d "$gnulib_path" ]; then
     echo "$0: getting gnulib files..."
@@ -628,13 +653,14 @@ case ${GNULIB_SRCDIR--} in
       # This fallback allows at least git 1.5.5.
       if test -f "$gnulib_path"/gnulib-tool; then
         # Since file already exists, assume submodule init already complete.
-        git submodule update || exit $?
+        git submodule update -- "$gnulib_path" || exit $?
       else
         # Older git can't clone into an empty directory.
         rmdir "$gnulib_path" 2>/dev/null
         git clone --reference "$GNULIB_SRCDIR" \
           "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
-          && git submodule init && git submodule update \
+          && git submodule init -- "$gnulib_path" \
+          && git submodule update -- "$gnulib_path" \
           || exit $?
       fi
     fi
diff --git a/gnulib b/gnulib
index 71be4c8..7177237 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 71be4c87c8267369f40fbfab7523ab9847154c02
+Subproject commit 7177237ead4c6080705129e6ec3c3a9e9eef2f68
diff --git a/src/ls.c b/src/ls.c
index 82402ee..5bee5e6 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -990,7 +990,7 @@ dev_ino_pop (void)
   struct dev_ino *di;
   int dev_ino_size = sizeof *di;
   assert (dev_ino_size <= obstack_object_size (&dev_ino_obstack));
-  obstack_blank (&dev_ino_obstack, -dev_ino_size);
+  obstack_blank_fast (&dev_ino_obstack, -dev_ino_size);
   vdi = obstack_next_free (&dev_ino_obstack);
   di = vdi;
   return *di;
diff --git a/tests/df/skip-duplicates.sh b/tests/df/skip-duplicates.sh
index 6b984ad..1de0132 100755
--- a/tests/df/skip-duplicates.sh
+++ b/tests/df/skip-duplicates.sh
@@ -90,6 +90,8 @@ struct mntent *getmntent (FILE *fp)
     {
       if (!mntents[done-2].mnt_type)
         mntents[done-2].mnt_type = "-";
+      if (!mntents[done-2].mnt_opts)
+        mntents[done-2].mnt_opts = "-";
       if (STREQ (mntents[done-2].mnt_dir, "/NONROOT"))
         mntents[done-2].mnt_dir = nonroot_fs;
       if (STREQ (mntents[done-2].mnt_dir, "/REMOTE"))
-- 
2.1.0




reply via email to

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