summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-01-16 00:03:37 +0000
committerOlivier Blin <oblin@mandriva.org>2004-01-16 00:03:37 +0000
commit81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92 (patch)
treec5f9d7afeac6211dc693772151b61127b4525f9e /urpm.pm
parent144b2ddb191ce4ac7f76950dd9bda65402d474c2 (diff)
downloadurpmi-81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92.tar
urpmi-81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92.tar.gz
urpmi-81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92.tar.bz2
urpmi-81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92.tar.xz
urpmi-81b3d92b9f72ed5e66dc42049d474ebf2e8b4a92.zip
added urpm::get_updates_description, print updates description in urpmq -i when available, do "unable to get source packages" test only when printing headers
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/urpm.pm b/urpm.pm
index 98b64e4a..c577a674 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2,6 +2,7 @@ package urpm;
use strict;
use vars qw($VERSION @ISA @EXPORT);
+use MDK::Common;
$VERSION = '4.4';
@ISA = qw(Exporter URPM);
@@ -3394,6 +3395,34 @@ sub check_sources_signatures {
sort keys %invalid_sources;
}
+#- get reason of update for packages to be updated
+#- use all update medias if none given
+sub get_updates_description {
+ my ($urpm, @update_medias) = @_;
+ my %update_descr;
+ my ($cur, $section);
+
+ @update_medias or @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}};
+
+ foreach (map { cat_("$urpm->{statedir}/descriptions.$_->{name}"), '%package dummy' } @update_medias) {
+ /^%package (.+)/ and do {
+ exists $cur->{importance} && !member($cur->{importance}, qw(security bugfix)) and $cur->{importance} = 'normal';
+ $update_descr{$_} = $cur foreach @{$cur->{pkgs}};
+ $cur = {};
+ $cur->{pkgs} = [ split /\s/, $1 ];
+ $section = 'pkg';
+ next;
+ };
+ /^Updated: (.+)/ && $section eq 'pkg' and $cur->{updated} = $1;
+ /^Importance: (.+)/ && $section eq 'pkg' and $cur->{importance} = $1;
+ /^%pre/ and do { $section = 'pre'; next };
+ /^%description/ and do { $section = 'description'; next };
+ $section eq 'pre' and $cur->{pre} .= $_;
+ $section eq 'description' and $cur->{description} .= $_;
+ }
+ \%update_descr;
+}
+
1;
__END__