aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) = @_;