[dpkg] 18/187: build: Check for the required minimal perl version

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository dpkg.

commit 5a0276aaac40c86a309a8a8e490f2d9a5c1805ca
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Sep 14 02:38:19 2016 +0200

    build: Check for the required minimal perl version
    
    We document the minimal perl version required at build and run-time, but
    we should instead do an actual check so that this is catched earlier and
    gives less surprises during the build process.
---
 debian/changelog |  1 +
 m4/dpkg-progs.m4 | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d4439cd..9245717 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Require libselinux 2.0.99 for baseline API, remove static linking
       support, use pkg-config unconditionally, and perform refinement checks
       only if available.
+    - Check for the required minimal perl version.
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
diff --git a/m4/dpkg-progs.m4 b/m4/dpkg-progs.m4
index 97e87ae..d9c4b21 100644
--- a/m4/dpkg-progs.m4
+++ b/m4/dpkg-progs.m4
@@ -7,10 +7,21 @@
 # Locate perl interpreter in the path
 AC_DEFUN([DPKG_PROG_PERL], [
   AC_ARG_VAR([PERL], [Perl interpreter])dnl
-  AC_PATH_PROG([PERL], [perl], [no])
-  AS_IF([test "$PERL" = "no" || test ! -x "$PERL"], [
-    AC_MSG_ERROR([cannot find the Perl interpreter])
+  m4_define([PERL_MIN_VERSION], [5.14.2])
+  AC_CACHE_CHECK([for perl >= PERL_MIN_VERSION], [ac_cv_path_PERL], [
+    AC_PATH_PROGS_FEATURE_CHECK([PERL], [perl], [
+      perlcheck=$(test -x $ac_path_PERL && \
+                  $ac_path_PERL -MConfig -Mversion -e \
+                  'my $r = qv("v$Config{version}") >= qv("PERL_MIN_VERSION");
+                   print "yes" if $r')
+      AS_IF([test "x$perlcheck" = "xyes"], [
+        ac_cv_path_PERL=$ac_path_PERL ac_path_PERL_found=:
+      ])
+    ], [
+      AC_MSG_ERROR([cannot find perl >= PERL_MIN_VERSION])
+    ])
   ])
+  AC_SUBST([PERL], [$ac_cv_path_PERL])
   AC_ARG_VAR([PERL_LIBDIR], [Perl library directory])dnl
   # Let the user override the variable.
   AS_IF([test -z "$PERL_LIBDIR"], [

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list