File: 0004-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch

package info (click to toggle)
flask-restful 0.3.10-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,232 kB
  • sloc: python: 3,946; makefile: 277; pascal: 26; sh: 20
file content (36 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 82bb3bfce4b3a3cedadde2410dbd9deac3c35327 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= <onovy@debian.org>
Date: Sun, 14 Aug 2016 00:50:39 +0200
Subject: Use SOURCE_DATE_EPOCH for copyright year to make build reproducible

Author: Chris Lamb <lamby@debian.org>
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809780
---
 docs/conf.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- flask-restful.orig/docs/conf.py
+++ flask-restful/docs/conf.py
@@ -11,9 +11,12 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-from datetime import date
 import os
 import sys
+import time
+import datetime
+
+BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
 
 # 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
@@ -46,7 +49,7 @@
 # General information about the project.
 project = u'Flask-RESTful'
 copyright = u'{}, Kevin Burke, Kyle Conroy, Ryan Horn, Frank Stratton, Guillaume Binet'.format(
-    date.today().year)
+    BUILD_DATE.year)
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the