Commit a2a3daeb authored by Thomas Goirand's avatar Thomas Goirand

Rebased patches.

parent bf5ecf7c
......@@ -2,6 +2,7 @@ swift (2.21.10+2019.07.13+git.4643412bd1-1) UNRELEASED; urgency=medium
* New upstream release.
* Switch swift to Python 3.
* Rebased patches.
-- Thomas Goirand <zigo@debian.org> Mon, 15 Jul 2019 15:09:23 +0200
......
......@@ -24,7 +24,7 @@ index 9c30acbb3..991e4ad4c 100644
import os
from swift import __version__
import subprocess
@@ -154,14 +155,19 @@ pygments_style = 'sphinx'
@@ -154,18 +155,19 @@
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
......@@ -40,7 +40,10 @@ index 9c30acbb3..991e4ad4c 100644
+if 'SOURCE_DATE_EPOCH' in os.environ:
+ now = float(os.environ.get('SOURCE_DATE_EPOCH'))
+ html_last_updated_fmt = datetime.datetime.utcfromtimestamp(now).isoformat()
+else:
else:
- if not isinstance(html_last_updated_fmt, str):
- # for py3
- html_last_updated_fmt = html_last_updated_fmt.decode('ascii')
+ git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'",
+ "--date=local", "-n1"]
+ try:
......@@ -50,23 +53,5 @@ index 9c30acbb3..991e4ad4c 100644
+ warnings.warn('Cannot get last updated time from git repository. '
+ 'Not setting "html_last_updated_fmt".')
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 64a27d629..7b96fcebb 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -72,7 +72,12 @@ master_doc = 'index'
# General information about the project.
project = u'Swift'
-copyright = u'%d, OpenStack Foundation' % datetime.datetime.now().year
+if 'SOURCE_DATE_EPOCH' in os.environ:
+ now = float(os.environ.get('SOURCE_DATE_EPOCH'))
+ now = datetime.datetime.utcfromtimestamp(now)
+else:
+ now = datetime.date.today()
+copyright = u'%d, OpenStack Foundation' % now.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
# If true, SmartyPants will be used to convert quotes and dashes to
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment