summaryrefslogtreecommitdiff
path: root/scripts/t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-09-16 03:31:25 +0200
committerGuillem Jover <guillem@debian.org>2018-09-18 23:40:58 +0200
commit9429372291069eab0f853f772fc76177413410ef (patch)
treef5cb0eb94246552597cd71f86d306ad8c8ce9db4 /scripts/t
parent04f63813361b97b7da13653d547736b00e852b90 (diff)
downloaddpkg-9429372291069eab0f853f772fc76177413410ef.tar.gz
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 <josch@debian.org>
Diffstat (limited to 'scripts/t')
-rw-r--r--scripts/t/Dpkg_Deps.t21
1 files changed, 20 insertions, 1 deletions
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';