8231279 : Change install location for copyright file for Debian package JDK-8200758-branch
authorherrick
Tue, 24 Sep 2019 13:50:40 -0400
branchJDK-8200758-branch
changeset 58303 88453b906981
parent 58302 718bd56695b3
child 58304 7a61351edad2
8231279 : Change install location for copyright file for Debian package Submitted-by: asemenyuk Reviewed-by: herrick, almatvee
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
test/jdk/tools/jpackage/share/LicenseTest.java
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Tue Sep 24 13:43:58 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Tue Sep 24 13:50:40 2019 -0400
@@ -39,6 +39,7 @@
 import java.util.*;
 import java.util.regex.Pattern;
 import java.util.stream.Stream;
+import static jdk.jpackage.internal.LinuxAppBundler.LINUX_INSTALL_DIR;
 
 import static jdk.jpackage.internal.StandardBundlerParam.*;
 import static jdk.jpackage.internal.LinuxPackageBundler.I18N;
@@ -363,8 +364,9 @@
 
     private File getConfig_CopyrightFile(Map<String, ? super Object> params) {
         PlatformPackage thePackage = createMetaPackage(params);
-        return thePackage.sourceRoot().resolve(Path.of("usr/share/doc",
-                thePackage.name(), "copyright")).toFile();
+        return thePackage.sourceRoot().resolve(Path.of(".",
+                LINUX_INSTALL_DIR.fetchFrom(params), PACKAGE_NAME.fetchFrom(
+                params), "share/doc/copyright")).toFile();
     }
 
     private File buildDeb(Map<String, ? super Object> params,
--- a/test/jdk/tools/jpackage/share/LicenseTest.java	Tue Sep 24 13:43:58 2019 -0400
+++ b/test/jdk/tools/jpackage/share/LicenseTest.java	Tue Sep 24 13:50:40 2019 -0400
@@ -110,9 +110,7 @@
     }
 
     private static Path debLicenseFile(JPackageCommand cmd) {
-        final Path licensePath = Path.of("/usr", "share", "doc",
-                LinuxHelper.getPackageName(cmd), "copyright");
-        return licensePath;
+        return cmd.appInstallationDirectory().resolve("share/doc/copyright");
     }
 
     private static void verifyLicenseFileInLinuxPackage(JPackageCommand cmd,