diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-01-10 15:27:47 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-01-10 16:42:03 +0100 |
commit | 5c0f77f4241c9beac0c82deae946bfdc70b49ff0 (patch) | |
tree | 11f7eae089d35528dd11896180250079bebb1444 /gnu/packages/patches | |
parent | a126e8120d30a3f66149f307a922acd77cde9d5a (diff) | |
download | guix-5c0f77f4241c9beac0c82deae946bfdc70b49ff0.tar.gz guix-5c0f77f4241c9beac0c82deae946bfdc70b49ff0.zip |
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.patch | 13 | ||||
-rw-r--r-- | gnu/packages/patches/jdk-currency-time-bomb2.patch | 13 |
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; |