# HG changeset patch
# User herrick
# Date 1564055960 14400
# Node ID e3b156ad362f04194981a3bfe17b93058f8d00be
# Parent 0af70fb0385320786d53b690aa57f0db61794120
8224627: Creating installer with --runtime-image on OS X fails
Reviewed-by: almatvee
diff -r 0af70fb03853 -r e3b156ad362f src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java
--- 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("");
i++;
} else if (lines[i].trim().equals("ChildBundles")) {
- skip = true;
- } else if (skip && lines[i].trim().equals("")) {
- skip = false;
+ ++skip;
+ } else if ((skip > 0) && lines[i].trim().equals("")) {
+ --skip;
} else {
- if (!skip) {
+ if (skip == 0) {
out.println(lines[i]);
}
}