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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=9429372291069eab0f853f772fc76177413410ef

commit 9429372291069eab0f853f772fc76177413410ef
Author: Guillem Jover <[email protected]>
AuthorDate: Sun Sep 16 03:31:25 2018 +0200

    Dpkg::Deps::KnownFacts: Satisfy :native with arch:all packages too
    
    Architecture:all packages are treated as native ones as part of the
    current multi-arch design, the only current exception is in
    build dependencies with the :native arch-qualifier.
    
    It looks like this was an oversight when implementing the :native
    support, as there's been no rationale found for the current behavior.
    
    Closes: #854438
    Analysis-by: Johannes Schauer <[email protected]>
---
 debian/changelog                |  5 +++++
 scripts/Dpkg/Deps/KnownFacts.pm |  3 ++-
 scripts/t/Dpkg_Deps.t           | 21 ++++++++++++++++++++-
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6fea9b501..d407098b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -163,6 +163,11 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
       conversion.
     - Dpkg::Control::Fields: Do not use & sigil for function calls.
     - Dpkg::Shlibs: Ignore nonexistent directories present in LD_LIBRARY_PATH.
+    - Dpkg::Deps::KnownFacts: Satisfy :native with arch:all packages too.
+      These are treated as native packages everywhere else in the multi-arch
+      design, this was the only exception, which has become a source of
+      packaging problems as of late. This was apparently an oversight in
+      the original implementation. Closes: #854438
   * Documentation:
     - Update gettext minimal version in README.
     - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph.
diff --git a/scripts/Dpkg/Deps/KnownFacts.pm b/scripts/Dpkg/Deps/KnownFacts.pm
index 95770ec00..192f6aa6b 100644
--- a/scripts/Dpkg/Deps/KnownFacts.pm
+++ b/scripts/Dpkg/Deps/KnownFacts.pm
@@ -167,7 +167,8 @@ sub _find_package {
         } elsif ($archqual eq 'any') {
             return $p if $ma eq 'allowed';
         } elsif ($archqual eq 'native') {
-            return $p if $a eq $build_arch and $ma ne 'foreign';
+            return if $ma eq 'foreign';
+            return $p if $a eq $build_arch or $a eq 'all';
         } else {
             return $p if $a eq $archqual;
         }
diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t
index 27fb12a15..14fe4e014 100644
--- a/scripts/t/Dpkg_Deps.t
+++ b/scripts/t/Dpkg_Deps.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 78;
+use Test::More tests => 82;
 
 use Dpkg::Arch qw(get_host_arch);
 use Dpkg::Version;
@@ -160,6 +160,8 @@ $facts->add_installed_package('pkg-ma-foreign2', '1.3.4-1', 
get_host_arch(), 'fo
 $facts->add_installed_package('pkg-ma-allowed', '1.3.4-1', 'somearch', 
'allowed');
 $facts->add_installed_package('pkg-ma-allowed2', '1.3.4-1', 'somearch', 
'allowed');
 $facts->add_installed_package('pkg-ma-allowed3', '1.3.4-1', get_host_arch(), 
'allowed');
+$facts->add_installed_package('pkg-indep-normal', '1.3.4-1', 'all', 'no');
+$facts->add_installed_package('pkg-indep-foreign', '1.3.4-1', 'all', 
'foreign');
 $facts->add_provided_package('myvirtual', undef, undef, 'mypackage');
 $facts->add_provided_package('myvirtual2', REL_EQ, '1.0-1', 'mypackage');
 $facts->add_provided_package('myvirtual3', REL_GE, '2.0-1', 'mypackage');
@@ -172,6 +174,23 @@ $dep_dup->simplify_deps($facts, $dep_opposite);
 is($dep_dup->output(), 'libc6 (>= 2.6-1), mypackage2, pkg-ma-allowed2',
     'Simplify deps');
 
+my $dep_ma_all_normal_implicit_native = deps_parse('pkg-indep-normal', 
build_dep => 1);
+my $dep_ma_all_normal_explicit_native = deps_parse('pkg-indep-normal:native', 
build_dep => 1);
+my $dep_ma_all_foreign_implicit_native = deps_parse('pkg-indep-foreign', 
build_dep => 1);
+my $dep_ma_all_foreign_explicit_native = 
deps_parse('pkg-indep-foreign:native', build_dep => 1);
+$dep_ma_all_normal_implicit_native->simplify_deps($facts);
+is($dep_ma_all_normal_implicit_native->output(), '',
+    'Simplify arch:all m-a:no w/ implicit :native (satisfied)');
+$dep_ma_all_normal_explicit_native->simplify_deps($facts);
+is($dep_ma_all_normal_explicit_native->output(), '',
+    'Simplify arch:all m-a:no w/ explicit :native (satisfied)');
+$dep_ma_all_foreign_implicit_native->simplify_deps($facts);
+is($dep_ma_all_foreign_implicit_native->output(), '',
+    'Simplify arch:all m-a:foreign w/ implicit :native (satisfied)');
+$dep_ma_all_foreign_explicit_native->simplify_deps($facts);
+is($dep_ma_all_foreign_explicit_native->output(), 'pkg-indep-foreign:native',
+    'Simplify arch:all m-a:foreign w/ explicit :native (unsatisfied)');
+
 TODO: {
 
 local $TODO = 'not yet implemented';

-- 
Dpkg.Org's dpkg

Reply via email to