summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2023-07-31 20:09:19 +0200
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-21 13:14:24 -0500
commit9b6a75a2782019d5ef930b8bbf8fc93f8129de72 (patch)
tree27a333e1fa1ab6ba15dce5500c69a53bc77c714f /gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
parent603cae3e98e7a9a765eee4e8bbd3af4fb230446f (diff)
gnu: openjdk15: Make reproducible.
* gnu/packages/java.scm (openjdk15)[source]: Add patch. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/patches/openjdk-15-jtask-reproducibility.patch')
-rw-r--r--gnu/packages/patches/openjdk-15-jtask-reproducibility.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch b/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
new file mode 100644
index 0000000000..2052983ade
--- /dev/null
+++ b/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
@@ -0,0 +1,40 @@
+--- 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java.orig 2022-04-04 10:57:40.346312924 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2022-04-04 11:01:38.480751902 +0200
+@@ -82,6 +82,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;
+
+@@ -750,6 +751,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
+@@ -765,14 +767,18 @@
+ if (out.contains(section, name)) {
+ warning("warn.ignore.duplicate.entry", name, section);
+ } else {
+- try (InputStream in = Files.newInputStream(file)) {
+- out.writeEntry(in, section, name);
+- }
++ paths.add(file);
+ }
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
++
++ for (Path file : paths) {
++ try (InputStream in = Files.newInputStream(file)) {
++ out.writeEntry(in, section, path.relativize(file).toString());
++ }
++ }
+ }
+
+ boolean matches(Path path, List<PathMatcher> matchers) {