summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm28
1 files changed, 11 insertions, 17 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 97fd85ba4..1240834a2 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -395,38 +395,32 @@ my $mdksub = "smp|enterprise|secure|linus|mosix|BOOT|custom";
sub sanitize_ver {
my $string = shift;
my $return;
- (my $ehad, my $chtaim, my $chaloch, my $arba, my $hamesh, my $chech); #where that names come from ;)
+ my ($ehad, $chtaim, $chaloch, $arba, $hamesh, $chech); #where that names come from ;)
- $string =~ m|([^-]+)-([^-]+)(-([^-]+))?(-([^-]*))?|;
- $ehad = $1; $chtaim = $2; $chaloch = $3; $arba = $4; $hamesh = $5; $chech = $6;
+ if ($string =~ m|([^-]+)-([^-]+)(-([^-]+))?(-([^-]*))?|) {
+ $ehad = $1; $chtaim = $2; $chaloch = $3; $arba = $4; $hamesh = $5; $chech = $6;
+ }
if ($chtaim =~ m|mdk| && $chech =~ m|mdk(${mdksub})|) { #new mdk with mdksub
my $s = $1;
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)\.(\d+)mdk|;
- $return = "$1$2$3-$4$s";
+ $return = "$1$2$3-$4$s" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)\.(\d+)mdk|;
} elsif ($chaloch =~ m|mdk| && $chtaim =~ /pre\d+/
&& $arba =~ m|(\d+)mdk(${mdksub})?|) { #new mdk with mdksub
my $r = $1;
my $s = $2 ? $2 : "";
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)pre(\d+)|;
- $return = "$1$2$3-p$4$r$s";
+ $return = "$1$2$3-p$4$r$s" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)pre(\d+)|;
} elsif ($chtaim =~ m|mdk$|) { #new mdk
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)\.(\d+)mdk$|;
- $return = "$1$2$3-$4";
+ $return = "$1$2$3-$4" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)\.(\d+)mdk$|;
} elsif ($chaloch =~ m|(\d+)mdk(${mdksub})$|) { #old mdk with mdksub
my $s = "$1$2";
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)|;
- $return = "$1$2$3-$s";
+ $return = "$1$2$3-$s" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)|;
} elsif ($chaloch =~ m|(\d+)mdk$|) { #old mdk
my $s = $1;
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)|;
- $return = "$1$2$3-$s";
+ $return = "$1$2$3-$s" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)|;
} elsif (!defined($chaloch)) { #linus/marcelo vanilla
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)$|;
- $return = "$1$2$3";
+ $return = "$1$2$3" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)$|;
} else { #a pre ac vanilla or whatever with EXTRAVERSION
- $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)$|;
- $return = "$1$2$3${chaloch}";
+ $return = "$1$2$3${chaloch}" if $chtaim =~ m|^(\d+)\.(\d+)\.(\d+)$|;
}
$return =~ s|\.||g; $return =~ s|mdk||; $return =~ s|secure|sec|; $return =~ s|enterprise|ent|;
return $return;