[PATCH] Updated reexp to extract version from basic Module::Install.

Paul Fenwick pjf at perltraining.com.au
Tue Nov 25 01:46:47 UTC 2008


---
 dh-make-perl |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dh-make-perl b/dh-make-perl
index b481df5..dc0dfdb 100755
--- a/dh-make-perl
+++ b/dh-make-perl
@@ -660,10 +660,19 @@ sub extract_name_ver_from_makefile {
         $vfrom = $4;
 
     }
-    elsif ( $file =~ /version\((\S+)\)/s ) {
+    elsif ( 
+        $file =~ m{
+            \bversion\b\s*                  # The word version
+            \(?\s*                          # Optional open-parens
+            (['"]?)                         # Optional quotes
+            ([\d_.]+)                       # The actual version.
+            \1                              # Optional close-quotes
+            \s*\)?                          # Optional close-parens.
+        }sx 
+    ) {
 
         # Module::Install
-        $ver = $1;
+        $ver = $2;
     }
 
     $dir = dirname($makefile) || './';
-- 
1.5.5.GIT


--------------020905020405070205070900
Content-Type: text/x-patch;
 name="0006-Trivial-test-script-in-lieu-of-having-Makefile.PL-to.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0006-Trivial-test-script-in-lieu-of-having-Makefile.PL-to.pa";
 filename*1="tch"



More information about the pkg-perl-maintainers mailing list