Accepting request 1103533 from Java:Factory
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/1103533 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/java-17-openjdk?expand=0&rev=25
This commit is contained in:
commit
2e6cc88fef
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 4 15:49:22 UTC 2023 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Added patch:
|
||||
* reproducible-javadoc-timestamp.patch
|
||||
+ use SOURCE_DATE_EPOCH in javadoc and make the javadoc
|
||||
generation more reproducible
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 25 06:21:18 UTC 2023 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
|
@ -170,6 +170,8 @@ Patch17: nss-security-provider.patch
|
||||
#
|
||||
Patch20: loadAssistiveTechnologies.patch
|
||||
#
|
||||
Patch21: reproducible-javadoc-timestamp.patch
|
||||
#
|
||||
# OpenJDK specific patches
|
||||
#
|
||||
Patch200: ppc_stack_overflow_fix.patch
|
||||
@ -413,6 +415,8 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2*
|
||||
|
||||
%patch20 -p1
|
||||
|
||||
%patch21 -p1
|
||||
|
||||
%patch200 -p1
|
||||
|
||||
%patch300 -p1
|
||||
|
60
reproducible-javadoc-timestamp.patch
Normal file
60
reproducible-javadoc-timestamp.patch
Normal file
@ -0,0 +1,60 @@
|
||||
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
|
||||
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
|
||||
@@ -213,6 +213,12 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
}
|
||||
docletVersion = v;
|
||||
|
||||
+ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
|
||||
+ startTime = new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
|
||||
+ } else {
|
||||
+ startTime = new Date();
|
||||
+ }
|
||||
+
|
||||
conditionalPages = EnumSet.noneOf(ConditionalPage.class);
|
||||
}
|
||||
protected void initConfiguration(DocletEnvironment docEnv,
|
||||
@@ -223,7 +229,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
}
|
||||
|
||||
private final Runtime.Version docletVersion;
|
||||
- public final Date startTime = new Date();
|
||||
+ public final Date startTime;
|
||||
|
||||
@Override
|
||||
public Runtime.Version getDocletVersion() {
|
||||
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java
|
||||
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java
|
||||
@@ -33,6 +33,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
+import java.util.TimeZone;
|
||||
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||
@@ -265,6 +266,9 @@ public class Head extends Content {
|
||||
|
||||
if (showTimestamp) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
+ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
|
||||
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
+ }
|
||||
tree.add(HtmlTree.META("dc.created", dateFormat.format(generatedDate)));
|
||||
}
|
||||
|
||||
@@ -298,7 +302,14 @@ public class Head extends Content {
|
||||
String text = "Generated by javadoc"; // marker string, deliberately not localized
|
||||
text += " (" + docletVersion.feature() + ")";
|
||||
if (timestamp) {
|
||||
- text += " on " + now;
|
||||
+ text += " on ";
|
||||
+ if (System.getenv("SOURCE_DATE_EPOCH") == null) {
|
||||
+ text += now;
|
||||
+ } else {
|
||||
+ SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
||||
+ fmt.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
+ text += fmt.format(now);
|
||||
+ }
|
||||
}
|
||||
return new Comment(text);
|
||||
}
|
Loading…
Reference in New Issue
Block a user