]> git.argeo.org Git - cc0/argeo-build.git/blobdiff - src/org/argeo/build/Repackage.java
Fix header cleaning
[cc0/argeo-build.git] / src / org / argeo / build / Repackage.java
index 88b2f37a44fbd81854344baa11b05639c56bb6af..909e2f456ba80510ae9cc867bacd56597d4dc7d7 100644 (file)
@@ -260,7 +260,7 @@ public class Repackage {
                                try (JarInputStream jarIn = new JarInputStream(Files.newInputStream(unmodifiedTarget))) {
                                        manifest = jarIn.getManifest();
                                }
-                               createSourceJar(unmodifiedTarget, manifest);
+                               createSourceJar(bundleDir, manifest);
                                return;
                        }
 
@@ -412,7 +412,8 @@ public class Repackage {
                                entries: while ((entry = jarIn.getNextJarEntry()) != null) {
                                        if (entry.isDirectory())
                                                continue entries;
-                                       if (entry.getName().endsWith(".RSA") || entry.getName().endsWith(".SF")) {
+                                       if (entry.getName().endsWith(".RSA") || entry.getName().endsWith(".DSA")
+                                                       || entry.getName().endsWith(".SF")) {
                                                origin.deleted.add("cryptographic signatures from " + artifact);
                                                continue entries;
                                        }
@@ -1009,24 +1010,26 @@ public class Repackage {
                                                        file.getFileName() + ": " + key + " was " + previousValue + ", overridden with " + value);
                        }
 
-                       // de-pollute MANIFEST
-                       switch (key) {
+                       // !! hack to remove unresolvable
+                       if (key.equals("Provide-Capability") || key.equals("Require-Capability"))
+                               if (nameVersion.getName().equals("osgi.core") || nameVersion.getName().equals("osgi.cmpn")) {
+                                       manifest.getMainAttributes().remove(key);
+                               }
+               }
+
+               // de-pollute MANIFEST
+               for (Object header : manifest.getMainAttributes().keySet()) {
+                       switch (header.toString()) {
                        case "Archiver-Version":
                        case "Build-By":
                        case "Created-By":
                        case "Originally-Created-By":
                        case "Tool":
                        case "Bnd-LastModified":
-                               manifest.getMainAttributes().remove(key);
+                               manifest.getMainAttributes().remove(header);
                                break;
                        default: // do nothing
                        }
-
-                       // !! hack to remove unresolvable
-                       if (key.equals("Provide-Capability") || key.equals("Require-Capability"))
-                               if (nameVersion.getName().equals("osgi.core") || nameVersion.getName().equals("osgi.cmpn")) {
-                                       manifest.getMainAttributes().remove(key);
-                               }
                }
 
                // license checks