Просмотр исходного кода

Dpkg::Arch: Multiple fixes to cope with empty triplets

With the changes introduced in 26a4d1df1119da0a8601b27198086086f9f3249f
debarch_to_debtriplet() and debwildcard_to_debtriplet() can now return an
empty list () instead of (undef) and the logic needs to be adjusted in
multiple place to cope with those changes.

The fixes in this commit might not be exhaustive, they correspond to
warnings that dpkg-source has been emitting. But given the number of
similar changes in the above commit, it's impossible for me to review
everything.
Raphaël Hertzog лет назад: 13
Родитель
Сommit
7e6096c215
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      scripts/Dpkg/Arch.pm

+ 2 - 2
scripts/Dpkg/Arch.pm

@@ -399,7 +399,7 @@ sub debarch_eq($$)
     my @a = debarch_to_debtriplet($a);
     my @b = debarch_to_debtriplet($b);
 
-    return 0 if grep(!defined, (@a, @b));
+    return 0 if grep(!defined, (@a, @b)) or !scalar(@a) or !scalar(@b);
 
     return ($a[0] eq $b[0] && $a[1] eq $b[1] && $a[2] eq $b[2]);
 }
@@ -413,7 +413,7 @@ sub debarch_is($$)
     my @real = debarch_to_debtriplet($real);
     my @alias = debwildcard_to_debtriplet($alias);
 
-    return 0 if grep(!defined, (@real, @alias));
+    return 0 if grep(!defined, (@real, @alias)) or !scalar(@real) or !scalar(@alias);
 
     if (($alias[0] eq $real[0] || $alias[0] eq 'any') &&
         ($alias[1] eq $real[1] || $alias[1] eq 'any') &&