aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-26 19:12:21 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-26 19:12:21 +0000
commite0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d (patch)
treec18415eefd07f1e1a6dcd6457beac2642aab1399
parent10c031a753e989577676f7e3b738fed012bc5acc (diff)
downloadperl-URPM-e0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d.tar
perl-URPM-e0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d.tar.gz
perl-URPM-e0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d.tar.bz2
perl-URPM-e0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d.tar.xz
perl-URPM-e0ba189a2b9b89c5a8dc118086ceb3c84b35aa6d.zip
(strict_arch_check,strict_arch_check_installed) simplify
-rw-r--r--URPM/Resolve.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 2621928..393ceff 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -130,11 +130,12 @@ my %installed_arch;
#- side-effects: none (but uses a cache)
sub strict_arch_check_installed {
my ($db, $pkg) = @_;
- if ($pkg->arch ne 'src' && $pkg->arch ne 'noarch') {
+ my $arch = $pkg->arch;
+ if ($arch ne 'src' && $arch ne 'noarch') {
my $n = $pkg->name;
defined $installed_arch{$n} or $installed_arch{$n} = get_installed_arch($db, $n);
if ($installed_arch{$n} && $installed_arch{$n} ne 'noarch') {
- $pkg->arch eq $installed_arch{$n} or return;
+ $arch eq $installed_arch{$n} or return;
}
}
1;
@@ -146,9 +147,11 @@ sub strict_arch_check_installed {
#- side-effects: none
sub strict_arch_check {
my ($installed_pkg, $pkg) = @_;
- if ($pkg->arch ne 'src' && $pkg->arch ne 'noarch') {
- if ($installed_pkg->arch ne 'noarch') {
- $pkg->arch eq $installed_pkg->arch or return;
+ my $arch = $pkg->arch;
+ if ($arch ne 'src' && $arch ne 'noarch') {
+ my $inst_arch = $installed_pkg->arch;
+ if ($inst_arch ne 'noarch') {
+ $arch eq $inst_arch or return;
}
}
1;