[libvirt] [PATCH] maint: update to latest gnulib

Eric Blake eblake at redhat.com
Mon Dec 8 23:48:37 UTC 2014


Several portability changes, but the one we are most interested in
is the improvement to bootstrap to detect perl modules.

This patch doesn't actually change our bootstrap requirements
(that will be a separate patch), but sets the stage for it.

* .gnulib: Update to latest, for bootstrap improvements.
* bootstrap: Regenerate from upstream.

Signed-off-by: Eric Blake <eblake at redhat.com>
---

Upstream gnulib is still working out an issue with modern mingw
supporting %lld in printf by default; until that is sorted, we do
not want to pick up gnulib cf88e56 in isolation.

Pushing under the gnulib maintenance rule, before we freeze.

* .gnulib 9565c3b...3914f31 (67):
  > bootstrap: Allow perl modules in $buildreq
  > apply _GL_ATTRIBUTE_PURE to some inline functions
  > vasnprintf: fix potential incorrect errno
  > vasnprintf: fix potential use after free
  > autoupdate
  > filevercmp, posixtm: avoid compiler warnings with -O3
  > Fix LDBL80_WORDS macro on big endian platforms.
  > autoupdate
  > git-version-gen: do not print new line characters
  > gnulib-tool: recognize x:* as an absolute path
  > argp: avoid extraneous translation and mem leak with empty pre doc
  > autoupdate
  > doc: mention that _BSD_SOURCE is deprecated for _DEFAULT_SOURCE
  > uniname/uniname-tests: skip if system's libunistring is used
  > printf: fix configure check on big endian systems
  > pipe-filter-gi, pipe-filter-ii: port to AIX
  > gitlog-to-changelog: add --until
  > update from texinfo
  > extern-inline: update commentary about GCC bugs
  > gen-uni-tables: untabify
  > gen-uni-tables: check out-of-range values added to 3-level tables
  > gen-uni-tables: utilize 'assert'
  > gen-uni-tables: cosmetic improvements
  > fcntl-h-tests: port to PA-RISC GNU/Linux
  > fts: port to C89
  > unistd: port to iOS
  > obstack: do not reject malloc-style obstack_chunkfun, obstack_freefun
  > autoupdate
  > update from texinfo
  > obstack: avoid potentially-nonportable function casts
  > obstack: fix macro return values
  > obstack: do not assume system-supplied obstack is size_t safe
  > obstack: port to platforms that #define __alignof__
  > linkat: don't unconditionally replace on GNU/Linux
  > linkat: wrap to handle symlinks on OS X 10.10
  > open, openat: document nonstandard FreeBSD, NetBSD O_NOFOLLOW errno
  > obstack: add NEWS entry for recent incompatible changes
  > mountlist: don't use libmount to decide on dummy/remote
  > maint: add missing ChangeLog entries for Modra's obstack changes
  > obstack: prefer __alignof__ to alignof
  > obstack: prefer alignof to calculating alignments by hand
  > obstack: use size_t alignments and check for overflow
  > obstack: 64-bit obstack support, part 3
  > obstack: 64-bit obstack support, part 2
  > obstack: 64-bit obstack support, part 1
  > obstack: tidy part 2
  > obstack: tidy part 1
  > socketlib, sockets, sys_socket: Use AC_REQUIRE to pacify autoconf.
  > iconv: avoid false detection of non-working iconv
  > bootstrap: print more diagnostics for missing programs
  > bootstrap: only update the gnulib submodule
  > symlinkat: port to AIX 7.1
  > readlinkat: port to AIX 7.1
  > remove spurious {
  > modules/fcntl: fix error reporting by dupfd
  > basename, dirname: Improve documentation.
  > exclude: declare exclude_patopts static
  > autoupdate
  > dirname: support compilation with C++
  > qsort_r: include <config.h>
  > avltree-list: avoid compiler warnings
  > qsort_r: new module, for GNU-style qsort_r
  > strerror_r-posix: support compilation with C++
  > fcntl-h: fix compilation with Intel C++ compiler
  > autoupdate
  > mountlist: use /proc/self/mountinfo when available
  > users.txt: add cmogstored

---
 .gnulib   |  2 +-
 bootstrap | 42 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/.gnulib b/.gnulib
index 9565c3b..3914f31 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 9565c3be73eb6d76b7b42a21d68d2e00a62abb6d
+Subproject commit 3914f3153576e9a5ba4002bde27de05211b5a79c
diff --git a/bootstrap b/bootstrap
index ce90bc4..e0c4ec2 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() {
-  ($1 --version </dev/null) >/dev/null 2>&1
+  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
-- 
1.9.3




More information about the libvir-list mailing list