8224627: Creating installer with --runtime-image on OS X fails
Reviewed-by: almatvee
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Mon Jul 15 09:44:36 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Thu Jul 25 07:59:20 2019 -0400
@@ -327,7 +327,8 @@
String[] lines = cplData.split("\n");
try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(
cpl.toPath()))) {
- boolean skip = false; // Used to skip Java.runtime bundle, since
+ int skip = 0;
+ // Used to skip Java.runtime bundle, since
// pkgbuild with --root will find two bundles app and Java runtime.
// We cannot generate component proprty list when using
// --component argument.
@@ -337,11 +338,11 @@
out.println("<false/>");
i++;
} else if (lines[i].trim().equals("<key>ChildBundles</key>")) {
- skip = true;
- } else if (skip && lines[i].trim().equals("</array>")) {
- skip = false;
+ ++skip;
+ } else if ((skip > 0) && lines[i].trim().equals("</array>")) {
+ --skip;
} else {
- if (!skip) {
+ if (skip == 0) {
out.println(lines[i]);
}
}