unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 3411ca12ae9c9d80603e837ced8d68dd6439afd4 2448 bytes (raw)
name: gnu/packages/patches/openjdk-10-jtask-reproducibility.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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) {

debug log:

solving 3411ca12ae ...
found 3411ca12ae in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).