]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: Allow perl modules in $buildreq
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 8 Dec 2014 12:19:12 +0000 (13:19 +0100)
committerEric Blake <eblake@redhat.com>
Mon, 8 Dec 2014 20:22:49 +0000 (13:22 -0700)
With this patch it is possible to put e.g. "perl::XML:XPath -" in
$buildreq in bootstrap.conf which will cause a check for perl module
XML::XPath using:

  perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1

If this fails due to any other error than XML::XPath missing, it is left
on the user to fix up his/her bootstrap.conf.  One of the examples
might be perl itself missing, which should be in $buildreq and precede
any perl::Module specifications.  Versioning of perl modules is not
supported.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
ChangeLog
build-aux/bootstrap

index 75b8eacf6cd2ed9c5d5dc0bb173eaec5459fe228..f308af032d4238e6c8db63508b0a6ff67cc121e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-08  Martin Kletzander  <mkletzan@redhat.com>  (tiny change)
+
+       bootstrap: Allow perl modules in $buildreq
+       * build-aux/bootstrap: Add case for perl modules.
+
 2014-12-08  Pádraig Brady  <P@draigBrady.com>
 
        apply _GL_ATTRIBUTE_PURE to some inline functions
index 4f0493ad9a185a14f238b8a76778d89218a396c7..e0c4ec2c3206ca5a9e0fa8e89ca415304243914d 100755 (executable)
@@ -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() {
@@ -456,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
 
@@ -473,6 +477,17 @@ 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