[Libreoffice-commits] core.git: Branch 'libreoffice-4-4-7' - solenv/bin

Andras Timar andras.timar at collabora.com
Tue Nov 24 07:29:25 PST 2015


 solenv/bin/modules/installer/windows/file.pm |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit df4afab6fcf653ee71762891b0bf287813726e45
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Nov 10 15:01:40 2015 +0100

    tdf#76239 extract file version from ttf files
    
    Change-Id: I59a9401c0bdc2d641ea54498af0eb1e589ab12f3
    (cherry picked from commit a322355727368ab087b718d32b70e4a9d9db645d)
    (cherry picked from commit 38e24f1d059a6123ea15a68b4b24ca984642d66e)
    Reviewed-on: https://gerrit.libreoffice.org/19945
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index 457b31a..bd72185 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -551,6 +551,26 @@ sub get_fileversion
             $fileversion = $version . "." . $subversion . "." . $microversion . "." . $vervariant;
         }
     }
+    # file version for font files (tdf#76239)
+    if ( $onefile->{'Name'} =~ /\.ttf$|\.TTF$/ )
+    {
+        open (TTF, "<$onefile->{'sourcepath'}");
+        binmode TTF;
+        {local $/ = undef; $ttfdata = <TTF>;}
+        close TTF;
+
+        my $ttfversion = "(Version )([0-9]+[.]*([0-9][.])*[0-9]+)";
+
+        if ($ttfdata =~ /$ttfversion/ms)
+        {
+            my ($version, $subversion, $microversion, $vervariant) = split(/\./,$2);
+            $fileversion = int($version) . "." . int($subversion) . "." . int($microversion) . "." . int($vervariant);
+        }
+        else
+        {
+            $fileversion = "1.0.0.0";
+        }
+    }
 
     return $fileversion;
 }


More information about the Libreoffice-commits mailing list