summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-10 22:30:23 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-10 22:30:23 +0000
commit21e13305eabb126bbafca4d34c9c2f75a8c04187 (patch)
tree8143dae154fec26b018e6a50f7bcc37afa2e201b
parent76f4a468bd97860af09ef6a6228bebb7ce97692b (diff)
downloadurpmi-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)
-rw-r--r--urpm.pm8
1 files changed, 4 insertions, 4 deletions
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} .= $_;