8229138: Add --linux-app-release option for DEB and RPM packages JDK-8200758-branch
authorherrick
Tue, 13 Aug 2019 18:21:07 -0400
branchJDK-8200758-branch
changeset 57741 38856ef4a19c
parent 57740 9b19a9cd651c
child 57742 e3d4b9bc5093
8229138: Add --linux-app-release option for DEB and RPM packages Reviewed-by: almatvee, asemenyuk
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Tue Aug 13 18:21:07 2019 -0400
@@ -734,6 +734,7 @@
         data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
         data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params));
         data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
+        data.put("APPLICATION_RELEASE", RELEASE.fetchFrom(params));
         data.put("APPLICATION_LAUNCHER_FILENAME", launcher);
         data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params));
         data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params));
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Tue Aug 13 18:21:07 2019 -0400
@@ -575,6 +575,7 @@
         data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params));
         data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
         data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
+        data.put("APPLICATION_RELEASE", RELEASE.fetchFrom(params));
         data.put("APPLICATION_LAUNCHER_FILENAME", launcher);
         data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params));
         data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params));
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control	Tue Aug 13 18:21:07 2019 -0400
@@ -1,5 +1,6 @@
 Package: APPLICATION_PACKAGE
 Version: APPLICATION_VERSION
+Release: APPLICATION_RELEASE
 Section: unknown
 Maintainer: APPLICATION_MAINTAINER
 Priority: optional
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec	Tue Aug 13 18:21:07 2019 -0400
@@ -1,7 +1,7 @@
 Summary: APPLICATION_SUMMARY
 Name: APPLICATION_PACKAGE
 Version: APPLICATION_VERSION
-Release: 1
+Release: APPLICATION_RELEASE
 License: APPLICATION_LICENSE_TYPE
 Vendor: APPLICATION_VENDOR
 Prefix: INSTALLATION_DIRECTORY
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java	Tue Aug 13 18:21:07 2019 -0400
@@ -103,6 +103,9 @@
         putUnlessNull(bundleParams, CLIOptions.VERSION.getId(),
                 getOptionValue(CLIOptions.VERSION));
 
+        putUnlessNull(bundleParams, CLIOptions.RELEASE.getId(),
+                getOptionValue(CLIOptions.RELEASE));
+
         putUnlessNull(bundleParams,
                 CLIOptions.WIN_CONSOLE_HINT.getId(),
                 getOptionValue(CLIOptions.WIN_CONSOLE_HINT));
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Tue Aug 13 18:21:07 2019 -0400
@@ -180,6 +180,8 @@
 
         VERSION ("app-version", OptionCategories.PROPERTY),
 
+        RELEASE ("linux-app-release", OptionCategories.PROPERTY),
+
         JAVA_OPTIONS ("java-options", OptionCategories.PROPERTY, () -> {
             List<String> args = getArgumentList(popArg());
             args.forEach(a -> setOptionValue("java-options", a));
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java	Tue Aug 13 18:21:07 2019 -0400
@@ -72,6 +72,9 @@
     // String - Application version. Format may differ for different bundlers
     public static final String PARAM_VERSION            = "appVersion";
 
+    // String - Application release. Used on Linux.
+    public static final String PARAM_RELEASE            = "appRelease";
+
     // String - Optional application description. Used by MSI and on Linux
     public static final String PARAM_DESCRIPTION        = "description";
 
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Tue Aug 13 18:21:07 2019 -0400
@@ -70,6 +70,8 @@
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.MainResources");
     private static final String JAVABASEJMOD = "java.base.jmod";
+    private final static String DEFAULT_VERSION = "1.0";
+    private final static String DEFAULT_RELEASE = "1";
 
     StandardBundlerParam(String id, Class<T> valueType,
             Function<Map<String, ? super Object>, T> defaultValueFunction,
@@ -256,7 +258,15 @@
             new StandardBundlerParam<>(
                     Arguments.CLIOptions.VERSION.getId(),
                     String.class,
-                    params -> I18N.getString("param.version.default"),
+                    params -> DEFAULT_VERSION,
+                    (s, p) -> s
+            );
+
+    static final StandardBundlerParam<String> RELEASE =
+            new StandardBundlerParam<>(
+                    Arguments.CLIOptions.RELEASE.getId(),
+                    String.class,
+                    params -> DEFAULT_RELEASE,
                     (s, p) -> s
             );
 
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Tue Aug 13 18:21:07 2019 -0400
@@ -126,6 +126,7 @@
             options.put(CLIOptions.LINUX_PACKAGE_DEPENDENCIES.getId(),
                         USE.INSTALL);
             options.put(CLIOptions.LINUX_MENU_GROUP.getId(), USE.INSTALL);
+            options.put(CLIOptions.RELEASE.getId(), USE.INSTALL);
         }
     }
 
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -256,6 +256,8 @@
 \          Required packages or capabilities for the application\n\
 \  --linux-rpm-license-type <type string>\n\
 \          Type of the license ("License: <value>" of the RPM .spec)\n\
+\  --linux-app-release <release value>\n\
+\          Release value of the RPM <name>.spec file or DEB control file.\n\
 
 MSG_Help_mac_linux_install_dir=\
 \Absolute path of the installation directory of the application\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -256,6 +256,8 @@
 \          Required packages or capabilities for the application\n\
 \  --linux-rpm-license-type <type string>\n\
 \          Type of the license ("License: <value>" of the RPM .spec)\n\
+\  --linux-app-release <release value>\n\
+\          Release value of the RPM <name>.spec file or DEB control file.\n\
 
 MSG_Help_mac_linux_install_dir=\
 \Absolute path of the installation directory of the application\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -256,6 +256,8 @@
 \          Required packages or capabilities for the application\n\
 \  --linux-rpm-license-type <type string>\n\
 \          Type of the license ("License: <value>" of the RPM .spec)\n\
+\  --linux-app-release <release value>\n\
+\          Release value of the RPM <name>.spec file or DEB control file.\n\
 
 MSG_Help_mac_linux_install_dir=\
 \Absolute path of the installation directory of the application\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -25,9 +25,8 @@
 #
 
 param.copyright.default=Copyright (C) {0,date,YYYY}
-param.description.default=none
+param.description.default=None
 param.vendor.default=Unknown
-param.version.default=1.0
 
 message.using-default-resource=Using default package resource {0} {1} (add {2} to the resource-dir to customize).
 message.no-default-resource=no default package resource {0} {1} (add {2} to the resource-dir to customize).
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -25,9 +25,8 @@
 #
 
 param.copyright.default=Copyright (C) {0,date,YYYY}
-param.description.default=none
+param.description.default=None
 param.vendor.default=Unknown
-param.version.default=1.0
 
 message.using-default-resource=Using default package resource {0} {1} (add {2} to the resource-dir to customize).
 message.no-default-resource=no default package resource {0} {1} (add {2} to the resource-dir to customize).
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Mon Aug 12 15:27:17 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Tue Aug 13 18:21:07 2019 -0400
@@ -25,9 +25,8 @@
 #
 
 param.copyright.default=Copyright (C) {0,date,YYYY}
-param.description.default=none
+param.description.default=None
 param.vendor.default=Unknown
-param.version.default=1.0
 
 message.using-default-resource=Using default package resource {0} {1} (add {2} to the resource-dir to customize).
 message.no-default-resource=no default package resource {0} {1} (add {2} to the resource-dir to customize).