diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-03-15 12:17:22 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-03-15 12:17:22 +0000 |
commit | b71fde90eac8a4902cd6e86506b93b36ba5589c1 (patch) | |
tree | be5a59524c57b3be572b7b9a1cbe632c8ff1a579 | |
parent | e957a83be8f75792758bdeb8131a4fd08ca1c919 (diff) | |
download | mgatools-b71fde90eac8a4902cd6e86506b93b36ba5589c1.tar mgatools-b71fde90eac8a4902cd6e86506b93b36ba5589c1.tar.gz mgatools-b71fde90eac8a4902cd6e86506b93b36ba5589c1.tar.bz2 mgatools-b71fde90eac8a4902cd6e86506b93b36ba5589c1.tar.xz mgatools-b71fde90eac8a4902cd6e86506b93b36ba5589c1.zip |
(cleanrpmsrate) try to make an over complicated if() more readable
-rw-r--r-- | pm/MGATools/rpmsrate.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pm/MGATools/rpmsrate.pm b/pm/MGATools/rpmsrate.pm index 0eee957..c325e5f 100644 --- a/pm/MGATools/rpmsrate.pm +++ b/pm/MGATools/rpmsrate.pm @@ -201,13 +201,18 @@ sub cleanrpmsrate { my ($d) = /(.*)-[^-]+/; my ($a, $b, $e, $do); - if ((!member($flags[0], @plain_flags) && s/(-devel)// ? ($b = "-devel") : /^$kernel_like/) && (($rpms{$_}) || (defined $rpms{"lib$_"} and $a = "lib") || (defined $rpms{"lib64$_"} and $a = "lib64") || (s/^lib(.*?)[_-]*[\d._]*(-.*)?$/$1$2/g && defined $rpms{"lib64$_"} and $a = 'lib64'))) { - $e = $rpms{"$a$_"}[1] . $rpms{"$a$_"}[0] . $rpms{"$a$_"}[2] . $b; - $do = 1; - } elsif ((!member($flags[0], @plain_flags) && /^$rpmsrate_dkms_like$/ && $rpms{"$1$2"})) { - $e = "$1-" . $rpms{"$1$2"}[0] . $2; - $do = 1; - } + if (!member($flags[0], @plain_flags)) { + if ((s/(-devel)// ? ($b = "-devel") : /^$kernel_like/) && + ($rpms{$_} || (defined $rpms{"lib$_"} and $a = "lib") || (defined $rpms{"lib64$_"} and $a = "lib64") + || (s/^lib(.*?)[_-]*[\d._]*(-.*)?$/$1$2/g && defined $rpms{"lib64$_"} and $a = 'lib64'))) { + $e = $rpms{"$a$_"}[1] . $rpms{"$a$_"}[0] . $rpms{"$a$_"}[2] . $b; + $do = 1; + } elsif (/^$rpmsrate_dkms_like$/ && $rpms{"$1$2"}) { + $e = "$1-" . $rpms{"$1$2"}[0] . $2; + $do = 1; + } + + } if ($do) { $keyword{$c} = $e; |