summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-05-17 12:35:04 +0000
committerThierry Vignaud <tv@mageia.org>2013-05-17 12:35:04 +0000
commit0de497b50811cfa096871eff490dc77ec1f35450 (patch)
treec441c9237028a7737adfd1670513cbe860314b5d
parent0131e1455c3a365872ff97006ea777adc56024ed (diff)
downloadurpmi-0de497b50811cfa096871eff490dc77ec1f35450.tar
urpmi-0de497b50811cfa096871eff490dc77ec1f35450.tar.gz
urpmi-0de497b50811cfa096871eff490dc77ec1f35450.tar.bz2
urpmi-0de497b50811cfa096871eff490dc77ec1f35450.tar.xz
urpmi-0de497b50811cfa096871eff490dc77ec1f35450.zip
enable to see if nonfree/tained packages are installed (mga#8368, #8379 & #9758)
-rw-r--r--NEWS2
-rw-r--r--urpm/media.pm21
2 files changed, 23 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index ba307085..9ee4d3a3 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@
instead of forcing users to click in order to continue
transactions (mga#6086)
o do not popup errors at end in auto mode
+- library (mga#8368, #8379 & #9758):
+ o enable to see if nonfree/tainted packages are installed
Version 7.26 - 2 May 2013, by Thierry Vignaud
diff --git a/urpm/media.pm b/urpm/media.pm
index 6148d680..81da468d 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -755,6 +755,27 @@ sub _auto_update_media {
}
}
+
+=item needed_extra_media($urpm)
+
+Return 2 booleans telling whether nonfree & tainted packages are installed respectively.
+
+=cut
+
+sub needed_extra_media {
+ my ($urpm) = @_;
+ my $db = urpm::db_open_or_die_($urpm);
+ my ($nonfree, $tainted);
+ $db->traverse(sub {
+ my ($pkg) = @_;
+ return if $nonfree && $tainted;
+ my $rel = $pkg->release;
+ $nonfree ||= $rel =~ /nonfree$/;
+ $tainted ||= $rel =~ /tainted$/;
+ });
+ ($nonfree, $tainted);
+}
+
sub non_ignored_media {
my ($urpm, $b_only_marked_update) = @_;