Your message dated Tue, 18 Sep 2018 13:12:48 +0300
with message-id <20180918101248.GB5786@localhost>
and subject line Fixed in 2.1.0-1
has caused the Debian Bug report #890280,
regarding ufo2ft: please make the output reproducible
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
890280: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890280
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: ufo2ft
Version: 1.1.0-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: toolchain timestamps
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that ufo2ft generates .otf files that are not reproducible.

For example, here is showotf output of fonts-league-spartan:

│ │ │ │ │  HEAD table (at 188)
│ │ │ │ │       Version=1
│ │ │ │ │       fontRevision=2
│ │ │ │ │ -     checksumAdj=e32dbbe4
│ │ │ │ │ +     checksumAdj=e3309724
│ │ │ │ │       magicNumber=5f0f3cf5 (0x5f0f3cf5, diff=0)
│ │ │ │ │       flags=3 baseline_at_0 lsb_at_0 
│ │ │ │ │       unitsPerEm=1250
│ │ │ │ │       create[0]=0
│ │ │ │ │ -      create[1]=d580d7b0
│ │ │ │ │ -     File created: Tue Jul  4 05:27:12 2017
│ │ │ │ │ +      create[1]=d57f6a10
│ │ │ │ │ +     File created: Mon Jul  3 03:27:12 2017

… which shows that it varies on the timezone.

Patch attached:

  --- a/Lib/ufo2ft/fontInfoData.py
  +++ b/Lib/ufo2ft/fontInfoData.py
  @@ -13,6 +13,7 @@ used externally as well.
   
   from __future__ import print_function, division, absolute_import, 
unicode_literals
   
  +import datetime
   import logging
   import math
   import time
  @@ -516,7 +517,8 @@ def intListToNum(intList, start, length):
   
   def dateStringToTimeValue(date):
       try:
  -        t = time.strptime(date, "%Y/%m/%d %H:%M:%S")
  -        return int(time.mktime(t))
  -    except OverflowError:
  +        dt = datetime.datetime.strptime(date, "%Y/%m/%d %H:%M:%S")
  +        dt = dt.replace(tzinfo=datetime.timezone.utc)
  +        return int(dt.timestamp())
  +    except ValueError:
           return 0


 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
diff --git a/Lib/ufo2ft/fontInfoData.py b/Lib/ufo2ft/fontInfoData.py
index 786823a..a487c62 100644
--- a/Lib/ufo2ft/fontInfoData.py
+++ b/Lib/ufo2ft/fontInfoData.py
@@ -13,6 +13,7 @@ used externally as well.
 
 from __future__ import print_function, division, absolute_import, 
unicode_literals
 
+import datetime
 import logging
 import math
 import time
@@ -516,7 +517,8 @@ def intListToNum(intList, start, length):
 
 def dateStringToTimeValue(date):
     try:
-        t = time.strptime(date, "%Y/%m/%d %H:%M:%S")
-        return int(time.mktime(t))
-    except OverflowError:
+        dt = datetime.datetime.strptime(date, "%Y/%m/%d %H:%M:%S")
+        dt = dt.replace(tzinfo=datetime.timezone.utc)
+        return int(dt.timestamp())
+    except ValueError:
         return 0

--- End Message ---
--- Begin Message ---
Version: 2.1.0-1

The fix is included in 2.1.0-1.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--- End Message ---

Reply via email to