aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-05-23 08:23:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-05-23 08:23:34 +0000
commitffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc (patch)
tree45a7bbc9fa94a28fc2279853d7e5f037ab367299 /URPM
parentd556e6285eaedfbcdf9c3e986cea23af3a59c905 (diff)
downloadperl-URPM-ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc.tar
perl-URPM-ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc.tar.gz
perl-URPM-ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc.tar.bz2
perl-URPM-ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc.tar.xz
perl-URPM-ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc.zip
- add is_package_installed() in URPM/Resolve.pm
(to be used in urpmi 5.20)
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index e270909..3a582fc 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -104,6 +104,18 @@ sub strict_arch_check {
1;
}
+#- side-effects: none
+sub is_package_installed {
+ my ($db, $pkg) = @_;
+
+ my $found;
+ $db->traverse_tag('name', [ $pkg->name ], sub {
+ my ($p) = @_;
+ $found ||= $p->fullname eq $pkg->fullname;
+ });
+ $found;
+}
+
sub _is_selected_or_installed {
my ($urpm, $db, $name) = @_;