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

Andras Timar andras.timar at collabora.com
Mon Nov 16 23:30:05 PST 2015


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

New commits:
commit 8149383121704a598eb4f87755e118c65fa38e5d
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/19944
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.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