bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] bootstrap: Allow perl modules in $buildreq


From: Martin Kletzander
Subject: Re: [PATCH] bootstrap: Allow perl modules in $buildreq
Date: Mon, 8 Dec 2014 12:18:51 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Dec 08, 2014 at 11:00:37AM +0000, Pádraig Brady wrote:
On 08/12/14 10:42, Martin Kletzander wrote:
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

looks useful...

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

If this fails due to any other error then XML::XPath missing, it is left
on the user to fix up his/hers 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 <address@hidden>
---
 build-aux/bootstrap | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index ce90bc4..8f948a0 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2013-12-05.23; # UTC
+scriptversion=2014-12-08.10; # UTC

 # Bootstrap this package from checked-out sources.

@@ -446,6 +446,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,6 +464,17 @@ check_versions() {
           ret=1
           continue
         } ;;
+      # Another check is for perl modules.  These can be written as
+      # e.g. per::XML::XPath in case of XML::XPath module, etc.

s/per/perl/

+      perl::*)
+        # Check for perl modules
+        app="${app#perl::}"
+        if ! perl -m"$app" -e 'exit 0' >/dev/null 2>&1; then

Should we honor $PERL here?


That'd be wise.  Also there should be PERL="${PERL-perl}" in the
beginning of the script, I guess, right?

Thank you for the review,
Martin

+          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


thanks,
Pádraig.

Attachment: signature.asc
Description: Digital signature


reply via email to

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