[Libreoffice-commits] core.git: solenv/bin

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Thu Oct 29 06:43:29 PDT 2015


 solenv/bin/modules/installer/filelists.pm |   24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

New commits:
commit c5465b860bacd3839446c38d988c6bdc14c539fe
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Thu Oct 29 14:31:35 2015 +0100

    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

diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm
index 7ca2f81..9c168c7 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;
             }
         }
     }


More information about the Libreoffice-commits mailing list