summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2023-07-31 20:09:14 +0200
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-21 13:14:23 -0500
commit8efaf0e6be809f9304c62be23eb752f8fa6e2a2f (patch)
tree2c996840a8ce433909ce1ee5851ae7e96944161b /gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
parent0a4daab96504dc34602b29eced879d306c9a6dda (diff)
gnu: openjdk10: Make more reproducible.
* gnu/packages/patches/openjdk-10-char-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-classlist-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-corba-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-jar-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-jtask-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-module-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-module3-reproducibility.patch: New file. * gnu/packages/patches/openjdk-10-module4-reproducibility.patch: New file. * gnu/packages/java.scm (openjdk10)[source]: Add patches. [arguments]<#:phases>[remove-timestamping]: New phase. * gnu/local.mk (dist_patch_DATA): Add patches. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/patches/openjdk-10-jtask-reproducibility.patch')
-rw-r--r--gnu/packages/patches/openjdk-10-jtask-reproducibility.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch b/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
new file mode 100644
index 0000000000..3411ca12ae
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
@@ -0,0 +1,53 @@
+--- jdk-10/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java.orig 2022-04-04 11:18:52.760626467 +0200
++++ jdk-10/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2022-04-04 12:03:40.645325687 +0200
+@@ -105,6 +105,7 @@
+ import jdk.internal.module.ModuleTarget;
+ import jdk.internal.module.Resources;
+ import jdk.tools.jlink.internal.Utils;
++import java.util.TreeSet;
+
+ import static java.util.stream.Collectors.joining;
+
+@@ -768,6 +769,7 @@
+ void processSection(JmodOutputStream out, Section section, Path path)
+ throws IOException
+ {
++ TreeSet<Path> paths = new TreeSet<>();
+ Files.walkFileTree(path, Set.of(FileVisitOption.FOLLOW_LINKS),
+ Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
+ @Override
+@@ -781,20 +783,24 @@
+
+ if (!relPath.toString().equals(MODULE_INFO)
+ && !matches(relPath, excludes)) {
+- try (InputStream in = Files.newInputStream(file)) {
+- out.writeEntry(in, section, relPath.toString());
+- } catch (IOException x) {
+- if (x.getMessage().contains("duplicate entry")) {
+- warning("warn.ignore.duplicate.entry",
+- relPath.toString(), section);
+- return FileVisitResult.CONTINUE;
+- }
+- throw x;
+- }
++ paths.add(file);
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
++ for (Path file : paths) {
++ Path relPath = path.relativize(file);
++ try (InputStream in = Files.newInputStream(file)) {
++ out.writeEntry(in, section, relPath.toString());
++ } catch (IOException x) {
++ if (x.getMessage().contains("duplicate entry")) {
++ warning("warn.ignore.duplicate.entry",
++ relPath.toString(), section);
++ continue;
++ }
++ throw x;
++ }
++ }
+ }
+
+ boolean matches(Path path, List<PathMatcher> matchers) {