diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Dpkg/Deps.pm | 3 | ||||
-rw-r--r-- | scripts/t/Dpkg_Deps.t | 22 |
2 files changed, 24 insertions, 1 deletions
diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index 885a6c2e1..88cb98eca 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -758,6 +758,9 @@ sub _arch_is_superset { # Because we are handling dependencies in isolation, and the full context # of the implications are only known when doing dependency resolution at # run-time, we can only assert that they are implied if they are equal. +# +# For example dependencies with different arch-qualifiers cannot be simplified +# as these depend on the state of Multi-Arch field in the package depended on. sub _arch_qualifier_implies { my ($p, $q) = @_; diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t index 71a3cf16a..a519f8166 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 => 70; +use Test::More tests => 74; use Dpkg::Arch qw(get_host_arch); use Dpkg::Version; @@ -233,6 +233,26 @@ is($dep_profiles->output(), 'libfoo-dev:native <!stage1>, libfoo-dev <!stage1 cross>', 'Simplification respects archqualifiers and profiles'); +my $dep_archqual = deps_parse('pkg, pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg, pkg:any', + 'Simplify respect arch-qualified ANDed dependencies 1/2'); + +$dep_archqual = deps_parse('pkg:amd64, pkg:any, pkg:i386'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg:amd64, pkg:any, pkg:i386', + 'Simplify respects arch-qualified ANDed dependencies 2/2'); + +$dep_archqual = deps_parse('pkg | pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg | pkg:any', + 'Simplify respect arch-qualified ORed dependencies 1/2'); + +$dep_archqual = deps_parse('pkg:amd64 | pkg:i386 | pkg:any'); +$dep_archqual->simplify_deps($facts); +is($dep_archqual->output(), 'pkg:amd64 | pkg:i386 | pkg:any', + 'Simplify respect arch-qualified ORed dependencies 2/2'); + my $dep_version = deps_parse('pkg, pkg (= 1.0)'); $dep_version->simplify_deps($facts); is($dep_version->output(), 'pkg (= 1.0)', 'Simplification merges versions'); |