summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2015-11-12 21:57:37 +0100
committerAndras Timar <andras.timar@collabora.com>2015-11-12 21:05:42 +0000
commit38e24f1d059a6123ea15a68b4b24ca984642d66e (patch)
tree6cab29a7309d955782e0691133330fd93c3dddea /solenv
parentda1f782cb2be82f605fe6b73420e40513f34ed1b (diff)
tdf#76239 extract real file version from ttf files
Change-Id: I9f611a272e6694fe1f9bd5f75358e865eaf3fe5f Reviewed-on: https://gerrit.libreoffice.org/19941 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/windows/file.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index c41be70ba115..bd72185fc9ac 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -551,10 +551,25 @@ sub get_fileversion
$fileversion = $version . "." . $subversion . "." . $microversion . "." . $vervariant;
}
}
- # fake file version for font files (tdf#76239)
+ # file version for font files (tdf#76239)
if ( $onefile->{'Name'} =~ /\.ttf$|\.TTF$/ )
{
- $fileversion = "1.0.0.0";
+ 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;