From ffaa6d703115cc1fcb1f00e2fe2fc5632ca953bc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 23 May 2008 08:23:34 +0000 Subject: - add is_package_installed() in URPM/Resolve.pm (to be used in urpmi 5.20) --- NEWS | 3 +++ URPM/Resolve.pm | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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) = @_; -- cgit v1.2.1