8231279 : Change install location for copyright file for Debian package
Submitted-by: asemenyuk
Reviewed-by: herrick, almatvee
--- 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,