diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-08-10 22:30:23 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-08-10 22:30:23 +0000 |
commit | 21e13305eabb126bbafca4d34c9c2f75a8c04187 (patch) | |
tree | 8143dae154fec26b018e6a50f7bcc37afa2e201b /urpm.pm | |
parent | 76f4a468bd97860af09ef6a6228bebb7ce97692b (diff) | |
download | urpmi-21e13305eabb126bbafca4d34c9c2f75a8c04187.tar urpmi-21e13305eabb126bbafca4d34c9c2f75a8c04187.tar.gz urpmi-21e13305eabb126bbafca4d34c9c2f75a8c04187.tar.bz2 urpmi-21e13305eabb126bbafca4d34c9c2f75a8c04187.tar.xz urpmi-21e13305eabb126bbafca4d34c9c2f75a8c04187.zip |
(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)
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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} .= $_; |