From 21e13305eabb126bbafca4d34c9c2f75a8c04187 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 10 Aug 2007 22:30:23 +0000 Subject: (get_updates_description) backport part of rafael commit in CVS r1.301:1.302: Make the parsing of "descriptions" file a bit better be more tolerant regarding spacing (not a issue with current description files) --- urpm.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 442c8f6a..c958dcda 100644 --- a/urpm.pm +++ b/urpm.pm @@ -235,19 +235,19 @@ sub get_updates_description { foreach my $medium (@update_medias) { foreach (cat_utf8(urpm::media::statedir_descriptions($urpm, $medium)), '%package dummy') { - /^%package (.+)/ and do { + /^%package +(.+)/ and do { if (exists $cur->{importance} && !member($cur->{importance}, qw(security bugfix))) { $cur->{importance} = 'normal'; } - $update_descr{$_} = $cur foreach @{$cur->{pkgs}}; + $update_descr{$_} = $cur foreach @{$cur->{pkgs} || []}; $cur = {}; $cur->{pkgs} = [ split /\s/, $1 ]; $cur->{medium} = $medium->{name}; $section = 'pkg'; next; }; - /^Updated?: (.+)/ && $section eq 'pkg' and $cur->{updated} = $1; - /^Importance: (.+)/ && $section eq 'pkg' and $cur->{importance} = $1; + /^Updated?: +(.+)/ && $section eq 'pkg' and $cur->{updated} = $1; + /^Importance: +(.+)/ && $section eq 'pkg' and $cur->{importance} = $1; /^(ID|URL): +(.+)/ && $section eq 'pkg' and do { $cur->{$1} = $2; next }; /^%(pre|description)/ and do { $section = $1; next }; $section =~ /^(pre|description)\z/ and $cur->{$1} .= $_; -- cgit v1.2.1