diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-14 13:37:06 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-14 13:37:06 +0000 |
commit | 0c5eb3c5059407533b7829476ebe6f21101b0028 (patch) | |
tree | 93ea88d1f9c11a20eaf309b69d348caf0155954b | |
parent | 8308b20318d04abf489b6c816ed23c8fdca9735d (diff) | |
download | rpmdrake-0c5eb3c5059407533b7829476ebe6f21101b0028.tar rpmdrake-0c5eb3c5059407533b7829476ebe6f21101b0028.tar.gz rpmdrake-0c5eb3c5059407533b7829476ebe6f21101b0028.tar.bz2 rpmdrake-0c5eb3c5059407533b7829476ebe6f21101b0028.tar.xz rpmdrake-0c5eb3c5059407533b7829476ebe6f21101b0028.zip |
Make the parsing of "descriptions" file a bit better
-rwxr-xr-x | rpmdrake | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -1197,20 +1197,22 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); my ($cur, $section); #- parse the description file foreach (map { cat_("$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}}; + /^%package +(.+)/ and do { + my @pkg_list = split /\s+/, $1; + exists $cur->{importance} && $cur->{importance} !~ /^(?:security|bugfix)\z/ + and $cur->{importance} = 'normal'; + $descriptions{$_} = $cur foreach @{$cur->{pkgs} || []}; $cur = {}; - $cur->{pkgs} = [ split /\s/, $1 ]; + $cur->{pkgs} = [ @pkg_list ]; $section = 'pkg'; next; }; - /^Updated?: (.+)/ && $section eq 'pkg' and $cur->{update} = $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} .= $_; + /^%(pre|description)/ and do { $section = $1; next }; + /^Updated?: +(.+)/ && $section eq 'pkg' + and do { $cur->{update} = $1; next }; + /^Importance: +(.+)/ && $section eq 'pkg' + and do { $cur->{importance} = $1; next }; + $section =~ /^(pre|description)\z/ and $cur->{$1} .= $_; } } my $wait = wait_msg_(N("Please wait, finding available packages...")); |