summaryrefslogtreecommitdiffstats
path: root/pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-15 12:17:22 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-15 12:17:22 +0000
commitb71fde90eac8a4902cd6e86506b93b36ba5589c1 (patch)
treebe5a59524c57b3be572b7b9a1cbe632c8ff1a579 /pm
parente957a83be8f75792758bdeb8131a4fd08ca1c919 (diff)
downloadmgatools-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
Diffstat (limited to 'pm')
-rw-r--r--pm/MGATools/rpmsrate.pm19
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;