Fridrich Strba 2023-09-14 16:34:58 +00:00 committed by Git OBS Bridge
parent 6608ac48d9
commit 35e9fae218
3 changed files with 118 additions and 1 deletions

107
groovy18-timestamp.patch Normal file
View File

@ -0,0 +1,107 @@
--- groovy-core-GROOVY_1_8_9/gradle/assemble.gradle 2023-09-14 17:55:59.522896097 +0200
+++ groovy-core-GROOVY_1_8_9/gradle/assemble.gradle 2023-09-14 18:31:52.621162384 +0200
@@ -45,6 +45,10 @@
binaryJarsMetaInf = {
Date buildTime = new Date()
+ def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH")
+ if (sourceDateEpoch != null) {
+ buildTime = new Date(1000 * Long.parseLong(sourceDateEpoch))
+ }
from "$projectDir/LICENSE.txt"
from("$projectDir/src/main/META-INF/groovy-release-info.properties") {
filter {String line ->
--- groovy-core-GROOVY_1_8_9/src/examples/transforms/global/CompiledAtASTTransformation.groovy 2023-09-14 17:55:59.532896167 +0200
+++ groovy-core-GROOVY_1_8_9/src/examples/transforms/global/CompiledAtASTTransformation.groovy 2023-09-14 18:18:30.645595375 +0200
@@ -16,7 +16,7 @@
@GroovyASTTransformation(phase=CompilePhase.CONVERSION)
public class CompiledAtASTTransformation implements ASTTransformation {
- private final static compileTime = new Date().toString()
+ private final static compileTime = System.getenv("SOURCE_DATE_EPOCH") != null ? new new Date(1000 * Long.parseLong(sourceDateEpoch)).toString() : new Date().toString()
public void visit(ASTNode[] astNodes, SourceUnit sourceUnit) {
--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html 2023-09-14 17:55:59.569563087 +0200
+++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html 2023-09-14 18:27:30.922678287 +0200
@@ -62,9 +62,9 @@
%>
<html>
<head>
-<!-- Generated by groovydoc (${GroovySystem.version}) on ${new Date()} -->
+<!-- Generated by groovydoc (${GroovySystem.version}) on ${System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)) : new Date()} -->
<title>${title}</title>
-<meta name="date" content="${new Date().format('yyyy-MM-dd')}">
+<meta name="date" content="${System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)).format('yyyy-MM-dd') : new Date().format('yyyy-MM-dd')}">
<meta http-equiv="Content-Type" content="text/html; charset=${props.charset}">
<link href="${classDoc.relativeRootPath}groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="${classDoc.relativeRootPath}groovy.ico" type="image/x-icon" rel="icon">
--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/deprecated-list.html 2023-09-14 17:55:59.569563087 +0200
+++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/deprecated-list.html 2023-09-14 18:29:48.580300951 +0200
@@ -38,9 +38,9 @@
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=${props.charset}">
-<!-- Generated by groovydoc (${GroovySystem.version}) on <% new Date() %> -->
+<!-- Generated by groovydoc (${GroovySystem.version}) on <% System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)) : new Date() %> -->
<title>${title}</title>
-<meta name="date" content="${new Date().format('yyyy-MM-dd')}">
+<meta name="date" content="${System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)).format('yyyy-MM-dd') : new Date().format('yyyy-MM-dd')}">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="groovy.ico" type="image/x-icon" rel="icon">
--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/help-doc.html 2023-09-14 17:55:59.569563087 +0200
+++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/help-doc.html 2023-09-14 18:30:08.917108852 +0200
@@ -3,7 +3,7 @@
<% def title = subtitle + (props.windowTitle ? " (${props.windowTitle})" : "") %>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=${props.charset}">
-<!-- Generated by groovydoc (${GroovySystem.version}) on <% new Date() %> -->
+<!-- Generated by groovydoc (${GroovySystem.version}) on <% System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)) : new Date() %> -->
<title>${title}</title>
<link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="groovy.ico" type="image/x-icon" rel="icon">
--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index-all.html 2023-09-14 17:55:59.569563087 +0200
+++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index-all.html 2023-09-14 18:29:08.500022604 +0200
@@ -16,9 +16,9 @@
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=${props.charset}">
-<!-- Generated by groovydoc (${GroovySystem.version}) on <% new Date() %> -->
+<!-- Generated by groovydoc (${GroovySystem.version}) on <% System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)) : new Date() %> -->
<title>${title}</title>
-<meta name="date" content="${new Date().format('yyyy-MM-dd')}">
+<meta name="date" content="${System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(sourceDateEpoch)).format('yyyy-MM-dd') : new Date().format('yyyy-MM-dd')}">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="groovy.ico" type="image/x-icon" rel="icon">
--- groovy-core-GROOVY_1_8_9/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxTimerFactory.groovy 2023-09-14 17:55:59.506229315 +0200
+++ groovy-core-GROOVY_1_8_9/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxTimerFactory.groovy 2023-09-14 18:08:37.814820693 +0200
@@ -93,7 +93,13 @@
}
private def getNormalizedDate(date) {
- if (!date) return new Date()
+ if (!date) {
+ def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH")
+ if (sourceDateEpoch != null) {
+ return new Date(1000 * Long.parseLong(sourceDateEpoch))
+ }
+ return new Date()
+ }
if (date instanceof Date) {
return date
}
@@ -102,8 +108,12 @@
case null:
case "now":
default:
+ if (sourceDateEpoch != null) {
+ startDate = new Date(1000 * Long.parseLong(sourceDateEpoch))
+ } else {
startDate = new Date()
}
+ }
return startDate
}

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Sep 14 16:34:06 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* groovy18-timestamp.patch
+ use SOURCE_DATE_EPOCH for timestamp in classes generated by
groovy
-------------------------------------------------------------------
Mon May 16 11:48:35 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package groovy18
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -45,6 +45,7 @@ Patch10: groovy18-asm7.patch
Patch11: groovy18-nofork.patch
Patch12: groovy18-jansi.patch
Patch13: groovy18-jline2.patch
Patch14: groovy18-timestamp.patch
BuildRequires: ant
BuildRequires: ant-antlr
BuildRequires: antlr
@ -141,6 +142,7 @@ cp %{SOURCE3} .
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
# build.xml is not compatible with Ant 1.10+
sed -i "s| depends=\"-excludeLegacyAntVersion\"||" build.xml