[Git][java-team/icedtea-web][master] Use SOURCE_DATE_EPOCH for the timestamps in the documentation to make the package reproducible

Emmanuel Bourg gitlab at salsa.debian.org
Wed Sep 11 23:17:58 BST 2019



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / icedtea-web


Commits:
153b2b11 by Emmanuel Bourg at 2019-09-11T22:15:31Z
Use SOURCE_DATE_EPOCH for the timestamps in the documentation to make the package reproducible

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/reproducible-documentation.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+icedtea-web (1.8.3-2) unstable; urgency=medium
+
+  * Team upload.
+  * Use SOURCE_DATE_EPOCH for the timestamps in the documentation to make
+    the package reproducible
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Thu, 12 Sep 2019 00:15:16 +0200
+
 icedtea-web (1.8.3-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/reproducible-documentation.patch
=====================================
@@ -0,0 +1,46 @@
+Description: Use SOURCE_DATE_EPOCH for the timestamps in the documentation to make the build reproducible
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java
++++ b/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java
+@@ -108,7 +108,7 @@
+ 
+     @Override
+     public String getHeaders(String id, String encoding) {
+-        return ".TH " + id + " 1 \"" + getManPageDate(true) + "\"" + " \"" + TextsProvider.ITW + " " + getVersion() + "\"" + PlainTextFormatter.getLineSeparator();
++        return ".TH " + id + " 1 \"" + getManPageDate(false) + "\"" + " \"" + TextsProvider.ITW + " " + getVersion() + "\"" + PlainTextFormatter.getLineSeparator();
+     }
+ 
+     @Override
+@@ -117,8 +117,8 @@
+     }
+ 
+     private String getManPageDate(boolean localize) {
+-        Date now = new Date();
+-        Calendar c = Calendar.getInstance();
++        Date now = System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date();
++        Calendar c = Calendar.getInstance(java.util.TimeZone.getTimeZone("UTC"));
+         c.setTime(now);
+         int day = c.get(Calendar.DAY_OF_MONTH);
+         int year = c.get(Calendar.YEAR);
+--- a/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java
++++ b/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java
+@@ -95,6 +95,9 @@
+         if (includeXmlHeader) {
+             xml = "<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n";
+         }
++        Date now = System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date();
++        java.text.DateFormat fmt = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
++        fmt.setTimeZone(java.util.TimeZone.getTimeZone("UTC"));
+         return xml + "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+                 + "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
+                 + "  <head>\n"
+@@ -102,7 +105,7 @@
+                 + "    <meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=" + encoding + "\" />\n"
+                 + "  </head>\n"
+                 + "  <body>\n"
+-                + "    <H5  align=\"right\">" + id + ": " + getVersion() + ", " + JNLPRuntime.getLocalisedTimeStamp(new Date()) + "</H5>";
++                + "    <H5  align=\"right\">" + id + ": " + getVersion() + ", " + fmt.format(now) + "</H5>";
+     }
+ 
+     @Override


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@ javaws_change_java_policy.diff
 doc-english-only.diff
 disable-applet-support.diff
 java11-compatibility.diff
+reproducible-documentation.patch



View it on GitLab: https://salsa.debian.org/java-team/icedtea-web/commit/153b2b114c53cfe8ee05a2966f3cd05cf30ba635

-- 
View it on GitLab: https://salsa.debian.org/java-team/icedtea-web/commit/153b2b114c53cfe8ee05a2966f3cd05cf30ba635
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190911/3a08c35c/attachment.html>


More information about the pkg-java-commits mailing list