From b71fde90eac8a4902cd6e86506b93b36ba5589c1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 15 Mar 2012 12:17:22 +0000 Subject: (cleanrpmsrate) try to make an over complicated if() more readable --- pm/MGATools/rpmsrate.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'pm') 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; -- cgit v1.2.1