diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2015-10-29 14:31:35 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2015-10-29 14:42:57 +0100 |
commit | c5465b860bacd3839446c38d988c6bdc14c539fe (patch) | |
tree | b45b0aa64c6bfb2a89c269b8520aa4a1e03e3a8a /solenv/bin | |
parent | 93e2e45e497bd55cd0fa0502a618d5326ce382b0 (diff) |
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
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer/filelists.pm | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm index 7ca2f8104c32..9c168c78472f 100644 --- a/solenv/bin/modules/installer/filelists.pm +++ b/solenv/bin/modules/installer/filelists.pm @@ -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; } } } |