Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8282007: Assorted enhancements to jpackage testing framework #7502

Closed
Original file line number Diff line number Diff line change
@@ -182,7 +182,10 @@ static PackageHandlers createDebPackageHandlers() {
};
deb.uninstallHandler = cmd -> {
cmd.verifyIsOfType(PackageType.LINUX_DEB);
Executor.of("sudo", "dpkg", "-r", getPackageName(cmd)).execute();
var packageName = getPackageName(cmd);
String script = String.format("! dpkg -s %s || sudo dpkg -r %s",
packageName, packageName);
Executor.of("sh", "-c", script).execute();
};
deb.unpackHandler = (cmd, destinationDir) -> {
cmd.verifyIsOfType(PackageType.LINUX_DEB);