Source: glances
Version: 2.6.2-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi,

Whilst working on the "reproducible builds" effort [0], we noticed that glances 
could not be built reproducibly.

Patch attached.

 [0] https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 02:00:00.000000000 
+0200
--- b/debian/patches/reproducible-build.patch   2016-06-23 15:41:16.679113281 
+0200
@@ -0,0 +1,14 @@
+--- glances-2.6.2.orig/docs/conf.py
++++ glances-2.6.2/docs/conf.py
+@@ -53,7 +53,10 @@ master_doc = 'index'
+ # General information about the project.
+ project = 'Glances'
+ author = 'Nicolas Hennion'
+-year = datetime.now().year
++try:
++    year = 
datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH'])).year
++except (KeyError, ValueError):
++    year = datetime.now().year
+ copyright = '%d, %s' % (year, author)
+ 
+ # The version info for the project you're documenting, acts as replacement for
--- a/debian/patches/reproducible-build.patch~  1970-01-01 02:00:00.000000000 
+0200
--- b/debian/patches/reproducible-build.patch~  2016-06-23 15:29:30.624780131 
+0200
@@ -0,0 +1,23 @@
+--- glances-2.6.2.orig/docs/conf.py
++++ glances-2.6.2/docs/conf.py
+@@ -14,7 +14,7 @@
+ 
+ import sys
+ import os
+-from datetime import datetime
++import datetime
+ 
+ # If extensions (or modules to document with autodoc) are in another 
directory,
+ # add these directories to sys.path here. If the directory is relative to the
+@@ -53,7 +53,10 @@ master_doc = 'index'
+ # General information about the project.
+ project = 'Glances'
+ author = 'Nicolas Hennion'
+-year = datetime.now().year
++try:
++    year = 
datetime.utcfromtimetsamp(int(os.environ['SOURCE_DATE_EPOCH'])).year
++except (KeyError, ValueError):
++    year = datetime.datetime.now().year
+ copyright = '%d, %s' % (year, author)
+ 
+ # The version info for the project you're documenting, acts as replacement for
--- a/debian/patches/series     2016-06-23 15:19:16.799274253 +0200
--- b/debian/patches/series     2016-06-23 15:27:01.587443299 +0200
@@ -1,2 +1,3 @@
 no_put_links_in_doc.diff
 not_install_static_dir.patch
+reproducible-build.patch

Reply via email to