Kaydet (Commit) c5465b86 authored tarafından Christian Lohmaier's avatar Christian Lohmaier

filelist split: condition the pattern instead the whole block

avoids a more complex regex with branches, and doesn't duplicate the
execution block

Change-Id: I48550c7ea2938001c139b9baecd1282727d7db31
üst 93e2e45e
......@@ -115,27 +115,19 @@ sub read_filelist
my $content = installer::files::read_file($path);
my @filelist = ();
# split on space, but only if followed by / (don't split within a filename)
my $splitRE = qr!\s+(?=/)!;
# filelist on win have C:/cygwin style however
$splitRE = qr!\s+(?=[A-Z]:/)! if ($installer::globals::os eq "WNT");
foreach my $line (@{$content})
{
chomp $line;
if ($installer::globals::os eq "WNT") # FIXME hack
foreach my $file (split $splitRE, $line)
{
foreach my $file (split /\s+/, $line)
if ($file ne "")
{
if ($file ne "")
{
push @filelist, $file;
}
}
}
else
{
foreach my $file (split /\s+(?=\/)/, $line)
{
if ($file ne "")
{
push @filelist, $file;
}
push @filelist, $file;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment