summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-01-10 15:27:47 +0100
committerLudovic Courtès <ludo@gnu.org>2024-01-10 16:42:03 +0100
commit5c0f77f4241c9beac0c82deae946bfdc70b49ff0 (patch)
tree11f7eae089d35528dd11896180250079bebb1444 /gnu/packages/patches
parenta126e8120d30a3f66149f307a922acd77cde9d5a (diff)
downloadguix-5c0f77f4241c9beac0c82deae946bfdc70b49ff0.tar.gz
gnu: icedtea: Fix time bomb in ‘GenerateCurrencyData.java’.
Fixes <https://issues.guix.gnu.org/68333>.

* gnu/packages/java.scm (icedtea-7)[drop]: Add optional ‘patches’
parameter and honor it.
[native-inputs]: Add patch for “jdk-drop”.
(icedtea-8): Likewise.
* gnu/packages/patches/jdk-currency-time-bomb.patch,
gnu/packages/patches/jdk-currency-time-bomb2.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.

Change-Id: I3b4cf562ce4bedb87ce0e7c289e431fbb0dbb6f8
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/jdk-currency-time-bomb.patch13
-rw-r--r--gnu/packages/patches/jdk-currency-time-bomb2.patch13
2 files changed, 26 insertions, 0 deletions
diff --git a/gnu/packages/patches/jdk-currency-time-bomb.patch b/gnu/packages/patches/jdk-currency-time-bomb.patch
new file mode 100644
index 0000000000..8e6bce6fcd
--- /dev/null
+++ b/gnu/packages/patches/jdk-currency-time-bomb.patch
@@ -0,0 +1,13 @@
+Fix a time bomb present in the jdk "drop" of IcedTea.
+
+--- a/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java
++++ b/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java
+@@ -284,7 +284,7 @@ public class GenerateCurrencyData {
+             String timeString = currencyInfo.substring(4, length - 4);
+             long time = format.parse(timeString).getTime();
+             if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) {
+-                throw new RuntimeException("time is more than 10 years from present: " + time);
++                System.err.println("note: time is more than 10 years from \"present\": " + time);
+             }
+             specialCaseCutOverTimes[specialCaseCount] = time;
+             specialCaseOldCurrencies[specialCaseCount] = oldCurrency;
diff --git a/gnu/packages/patches/jdk-currency-time-bomb2.patch b/gnu/packages/patches/jdk-currency-time-bomb2.patch
new file mode 100644
index 0000000000..94454626c4
--- /dev/null
+++ b/gnu/packages/patches/jdk-currency-time-bomb2.patch
@@ -0,0 +1,13 @@
+Fix a time bomb present in the jdk "drop" of IcedTea 8.
+
+--- a/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
++++ b/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
+@@ -284,7 +284,7 @@ public class GenerateCurrencyData {
+             String timeString = currencyInfo.substring(4, length - 4);
+             long time = format.parse(timeString).getTime();
+             if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) {
+-                throw new RuntimeException("time is more than 10 years from present: " + time);
++                System.err.println("note: time is more than 10 years from \"present\": " + time);
+             }
+             specialCaseCutOverTimes[specialCaseCount] = time;
+             specialCaseOldCurrencies[specialCaseCount] = oldCurrency;