JDK-8227312: Remove pkg bundle from DMG image. JDK-8200758-branch
authorherrick
Thu, 25 Jul 2019 17:27:53 -0400
branchJDK-8200758-branch
changeset 57554 cb6733b3ed62
parent 57553 96335b232d4d
child 57555 02d3f1d03abb
JDK-8227312: Remove pkg bundle from DMG image. Reviewed-by: kcr
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java
test/jdk/tools/jpackage/macosx/base/OptionsBase.java
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java	Thu Jul 25 17:07:08 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java	Thu Jul 25 17:27:53 2019 -0400
@@ -140,7 +140,7 @@
             }
             // first, make sure we don't use the local signing key
             params.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null);
-            File appLocation = prepareAppBundle(params, false);
+            File appLocation = prepareAppBundle(params);
 
             prepareEntitlements(params);
 
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java	Thu Jul 25 17:07:08 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java	Thu Jul 25 17:27:53 2019 -0400
@@ -134,21 +134,17 @@
         }
     }
 
-    protected File prepareAppBundle(Map<String, ? super Object> params,
-            boolean pkg) throws PackagerException {
+    protected File prepareAppBundle(Map<String, ? super Object> params)
+            throws PackagerException {
         File predefinedImage =
                 StandardBundlerParam.getPredefinedAppImage(params);
         if (predefinedImage != null) {
             return predefinedImage;
         }
         File appImageRoot = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
-        if (pkg) {
-            // create pkg in dmg
-            return new MacPkgBundler().bundle(params, appImageRoot);
-        } else {
-            return APP_BUNDLER.fetchFrom(params).doBundle(
-                    params, appImageRoot, true);
-        }
+
+        return APP_BUNDLER.fetchFrom(params).doBundle(
+                params, appImageRoot, true);
     }
 
     @Override
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java	Thu Jul 25 17:07:08 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java	Thu Jul 25 17:27:53 2019 -0400
@@ -61,7 +61,7 @@
         try {
             appImageDir.mkdirs();
 
-            if (prepareAppBundle(params, true) != null &&
+            if (prepareAppBundle(params) != null &&
                     prepareConfigFiles(params)) {
                 File configScript = getConfig_Script(params);
                 if (configScript.exists()) {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Thu Jul 25 17:07:08 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Thu Jul 25 17:27:53 2019 -0400
@@ -138,9 +138,8 @@
 
         IOUtils.writableOutputDir(outdir.toPath());
 
-        File appImageDir = null;
         try {
-            appImageDir = prepareAppBundle(params, false);
+            File appImageDir = prepareAppBundle(params);
 
             if (appImageDir != null && prepareConfigFiles(params)) {
 
--- a/test/jdk/tools/jpackage/macosx/base/OptionsBase.java	Thu Jul 25 17:07:08 2019 -0400
+++ b/test/jdk/tools/jpackage/macosx/base/OptionsBase.java	Thu Jul 25 17:27:53 2019 -0400
@@ -51,9 +51,11 @@
                 try(var br = new BufferedReader(new FileReader(log))) {
                     var line = br.lines().reduce((a, b) -> b).orElse(null)
                             .split("\t");
-                    disk = line[0].trim();
-                    testPkg(line[2].trim() + File.separator + TEST_NAME +
-                            "-1.0.pkg");
+                    if ((line.length < 3) || !line[2].contains(TEST_NAME)) {
+                        throw new AssertionError(
+                                "expected attach output to contain test name: "
+                                + TEST_NAME);
+                    }
                 }
             } finally {
                 if (disk != null) {