summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-15 08:20:21 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-15 08:20:21 +0000
commit5dc357257f5aed61526bf964b3fb43315d611552 (patch)
tree05c1ca6e741f8de5805d2c758e6a546239b4dac7
parent2e1332d02ac463bb80a4b6253d5175798ef9ffde (diff)
downloadmgatools-5dc357257f5aed61526bf964b3fb43315d611552.tar
mgatools-5dc357257f5aed61526bf964b3fb43315d611552.tar.gz
mgatools-5dc357257f5aed61526bf964b3fb43315d611552.tar.bz2
mgatools-5dc357257f5aed61526bf964b3fb43315d611552.tar.xz
mgatools-5dc357257f5aed61526bf964b3fb43315d611552.zip
make it a little more readable
-rw-r--r--pm/MGATools/rpmsrate.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/pm/MGATools/rpmsrate.pm b/pm/MGATools/rpmsrate.pm
index 4a41ce0..c2d519a 100644
--- a/pm/MGATools/rpmsrate.pm
+++ b/pm/MGATools/rpmsrate.pm
@@ -53,7 +53,10 @@ sub cleanrpmsrate {
chomp;
s/#.*//;
#s/\s*$//;
- /^(\s*)$/ and push @rpmsrate, [ '', 0, '', [] ] and next;
+ if (/^(\s*)$/) {
+ push @rpmsrate, [ '', 0, '', [] ];
+ next;
+ }
if (/^(\S+)(.*)$/) {
push @rpmsrate, [ 0, 0, $1, [], $2 ];
next;
@@ -64,8 +67,7 @@ sub cleanrpmsrate {
}
my ($indent, $r, $flags, $data) = /^(\s*)([1-5])?(\s*(?:(?:(?:!\s*)?[0-9A-Z_]+(?:"[^"]*")?(?:\s+(?:\|\|\s+)?)*)+\s+)|\s*)(.*)$/;
my ($postfix) = $data =~ /(\s*)$/;
- my @data;
- my $i;
+ my (@data, $i);
foreach ([$data =~ /(?:^|\s)(\S+)-(?:\S+)\s+\1-(?:\S+)(?:\s|$)/g], [split ' ', $data]) {
$data[$i++] = [ @$norpmsrate ? any { my $r = $_; $r if !any { $r =~ /$_/ } @$norpmsrate } @$_ : @$_ ];
}
@@ -73,9 +75,7 @@ sub cleanrpmsrate {
push @rpmsrate, [ $indent,$r, $flags, $data[1], $postfix ];
}
- my (%rpms, $text);
- my (%rate, %section, %keyword);
- my (%locale, %localized_pkg);
+ my (%rpms, $text, %rate, %section, %keyword, %locale, %localized_pkg);
my @plain_flags = qw(INSTALL LIVE);
my $kernel_like = "((?:(?:NVIDIA_)?kernel|NVIDIA_nforce|cm2020).*)";
my $dkms_like = "(.*)([-_])kernel-([0-9]+(?:\.[0-9]+){2,3}-[0-9]+(?:.[^.]+){0,2}md[vk])(.*)";