aboutsummaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--NEWS3
-rw-r--r--URPM/Resolve.pm12
2 files changed, 15 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3fea9ac..bfd51e5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- add is_package_installed() in URPM/Resolve.pm
+ (to be used in urpmi 5.20)
+
Version 3.13 - 20 May 2008, by Pascal "Pixel" Rigaux
- do not ignore dropped provide from updated package (mdvbz#40842)
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) = @_;