[SCM] Debian native package for Config::Model::Dpkg branch, master, updated. debian/2.036-21-ge5a8209

Dominique Dumont dod at debian.org
Fri May 24 11:48:46 UTC 2013


The following commit has been merged in the master branch:
commit d1c1a70f71e359430a4e2fa22060e53a1fc3e7e8
Author: Dominique Dumont <dod at debian.org>
Date:   Fri May 24 13:47:55 2013 +0200

    trap mismatched '!' in dependency arch declaration

diff --git a/lib/Config/Model/Dpkg/Dependency.pm b/lib/Config/Model/Dpkg/Dependency.pm
index bdd5e37..8942b5b 100644
--- a/lib/Config/Model/Dpkg/Dependency.pm
+++ b/lib/Config/Model/Dpkg/Dependency.pm
@@ -87,7 +87,21 @@ pkg_dep: pkg_name dep_version(?) arch_restriction(?) {
     $return = \@ret ; ;
    } 
 
-arch_restriction: '[' osarch(s) ']' { $return = $item[2] ;}
+arch_restriction: '[' osarch(s) ']'
+    {
+        my $mismatch = 0;
+        my $ref = $item[2] ;
+        for (my $i = 0; $i < $#$ref -1 ; $i++ ) {
+            $mismatch ||= (($ref->[$i][0] eq '!') xor ($ref->[$i+1][0] eq '!')) ;
+        }
+        my @a = map { ($_->[0] || '') . ($_->[1] || '') . $_->[2] } @$ref ;
+        if ($mismatch) {
+            $add_error->("some names are prepended with '!' while others aren't.", "@a") ;
+        }
+        else {
+            $return = \@a ;
+        }
+    }
 
 dep_version: '(' oper version ')' { $return = [ $item{oper}, $item{version} ] ;} 
 
@@ -103,7 +117,7 @@ version: variable | /[\w\.\-~:+]+(?=\s|\)|\Z)/
 # valid arch are listed by dpkg-architecture -L
 osarch: not(?) os(?) arch
     {
-        $return = ($item[1][0] || '') . ($item[2][0] || '') . $item[3] ;
+        $return =  [ $item[1][0], $item[2][0], $item[3] ];
     }
 
 not: '!'

-- 
Debian native package for Config::Model::Dpkg



More information about the Pkg-perl-cvs-commits mailing list