[DRE-commits] [asciidoctor] 01/03: Honour SOURCE_DATE_EPOCH to make build of packages using ronn reproducible.
Cédric Boutillier
boutil at moszumanska.debian.org
Wed Jun 8 19:55:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository asciidoctor.
commit ded737b7a0bc51701d17f438f9f3908a0d0f535f
Author: Cédric Boutillier <boutil at debian.org>
Date: Wed Jun 8 21:46:10 2016 +0200
Honour SOURCE_DATE_EPOCH to make build of packages using ronn reproducible.
---
debian/changelog | 7 +++++
debian/patches/honour_SOURCE_DATE_EPOCH.patch | 45 +++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 53 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 02c1e7a..5ea9040 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+asciidoctor (1.5.4-1.0~reproducible1) unstable; urgency=medium
+
+ * Honour SOURCE_DATE_EPOCH to make build of packages using ronn
+ reproducible.
+
+ -- Alexis Bienvenüe <pado at passoire.fr> Fri, 08 Apr 2016 11:20:04 +0200
+
asciidoctor (1.5.4-1) unstable; urgency=medium
* Team upload
diff --git a/debian/patches/honour_SOURCE_DATE_EPOCH.patch b/debian/patches/honour_SOURCE_DATE_EPOCH.patch
new file mode 100644
index 0000000..2fc6b21
--- /dev/null
+++ b/debian/patches/honour_SOURCE_DATE_EPOCH.patch
@@ -0,0 +1,45 @@
+Description: Honour the SOURCE_DATE_EPOCH environment variable
+ Honour the SOURCE_DATE_EPOCH environment variable, so that output documents'
+ timestamp is set to last debian/changelog entry when building packages that
+ use asciidoctor in their building process.
+Author: Alexis Bienvenüe <pado at passoire.fr>
+Forwarded: https://github.com/asciidoctor/asciidoctor/pull/1721
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820435
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2016-06-08
+
+
+Index: asciidoctor-1.5.4/lib/asciidoctor/document.rb
+===================================================================
+--- asciidoctor-1.5.4.orig/lib/asciidoctor/document.rb
++++ asciidoctor-1.5.4/lib/asciidoctor/document.rb
+@@ -401,7 +401,11 @@ class Document < AbstractBlock
+ #attrs['infile'] = attrs['docfile']
+
+ # dynamic intrinstic attribute values
+- now = ::Time.now
++ if ENV['SOURCE_DATE_EPOCH'].nil?
++ now = ::Time.now
++ else
++ now = ::Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
++ end
+ localdate = (attrs['localdate'] ||= now.strftime('%Y-%m-%d'))
+ unless (localtime = attrs['localtime'])
+ begin
+Index: asciidoctor-1.5.4/lib/asciidoctor.rb
+===================================================================
+--- asciidoctor-1.5.4.orig/lib/asciidoctor.rb
++++ asciidoctor-1.5.4/lib/asciidoctor.rb
+@@ -1308,7 +1308,11 @@ module Asciidoctor
+ if ::File === input
+ # TODO cli checks if input path can be read and is file, but might want to add check to API
+ input_path = ::File.expand_path input.path
+- input_mtime = input.mtime
++ if ENV['SOURCE_DATE_EPOCH'].nil?
++ input_mtime = input.mtime
++ else
++ input_mtime = ::Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
++ end
+ lines = input.readlines
+ # hold off on setting infile and indir until we get a better sense of their purpose
+ attributes['docfile'] = input_path
diff --git a/debian/patches/series b/debian/patches/series
index ea7f6da..49cacf6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ lib_directory_in_tests.patch
skip-asciimath-test.patch
package-version.patch
skip-unreadable-file.patch
+honour_SOURCE_DATE_EPOCH.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/asciidoctor.git
More information about the Pkg-ruby-extras-commits
mailing list