Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE
Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/989[#989]: Allow expressions in template variable definitions
* https://github.com/devonfw/IDEasy/issues/950[#950]: Avoid non-interactive GPG handling for Rancher Desktop on SUSE

The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/50?closed=1[milestone 2026.09.002].

Expand Down
26 changes: 26 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/tool/NativePackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class NativePackage {
private final List<String> extraInstallOptions;
private final List<String> setupCommands;
private final List<String> cleanupCommands;
private final boolean interactiveInstall;

/**
* Creates a new {@link NativePackage} with optional fields defaulting to empty lists.
Expand All @@ -25,11 +26,29 @@ public class NativePackage {
*/
public NativePackage(NativePackageManager pm, List<String> packages,
List<String> extraInstallOptions, List<String> setupCommands, List<String> cleanupCommands) {
this(pm, packages, extraInstallOptions, setupCommands, cleanupCommands, false);
}

/**
* Creates a new {@link NativePackage}.
*
* @param pm the specific {@link NativePackageManager}
* @param packages the packages that need to be handled.
* @param extraInstallOptions extra install options (optional)
* @param setupCommands commands to run before install (optional)
* @param cleanupCommands commands to run after uninstall (optional)
* @param interactiveInstall {@code true} to allow interactive user input during installation, {@code false} otherwise.
*/
public NativePackage(NativePackageManager pm, List<String> packages,
List<String> extraInstallOptions, List<String> setupCommands, List<String> cleanupCommands,
boolean interactiveInstall) {

this.packageManager = Objects.requireNonNull(pm, "package manager must not be null");
this.packages = List.copyOf(Objects.requireNonNull(packages, "packages must not be null"));
this.extraInstallOptions = extraInstallOptions != null ? List.copyOf(extraInstallOptions) : List.of();
this.setupCommands = setupCommands != null ? List.copyOf(setupCommands) : List.of();
this.cleanupCommands = cleanupCommands != null ? List.copyOf(cleanupCommands) : List.of();
this.interactiveInstall = interactiveInstall;
}

/**
Expand Down Expand Up @@ -109,4 +128,11 @@ public PackageManagerCommand uninstall() {
public List<String> getVersionQueryCommand() {
return this.packageManager.getVersionQueryCommand(this.packages.getFirst());
}

/**
* @return {@code true} if this package should be installed interactively, {@code false} otherwise.
*/
public boolean isInteractiveInstall() {
return this.interactiveInstall;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ public PackageManagerCommand install(NativePackage nativePackage, String version
for (String option : nativePackage.getExtraInstallOptions()) {
command.append(' ').append(option);
}
command.append(' ').append(this.installCommand);

String installCommand = this.installCommand;
if ((this == ZYPPER) && nativePackage.isInteractiveInstall()) {
installCommand = "install";
}
command.append(' ').append(installCommand);

for (String pkg : nativePackage.getPackages()) {
command.append(' ').append(getPackageSpec(pkg, version));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ protected List<NativePackage> getNativePackages() {
new NativePackage(
NativePackageManager.ZYPPER,
List.of("rancher-desktop"),
List.of("--no-gpg-checks"),
List.of(),
List.of("sudo zypper addrepo https://download.opensuse.org/repositories/isv:/Rancher:/stable/rpm/isv:Rancher:stable.repo"),
null
null,
true
),
new NativePackage(
NativePackageManager.APT,
Expand All @@ -91,7 +92,8 @@ protected List<NativePackage> getNativePackages() {
List.of(
"sudo rm -f /etc/apt/sources.list.d/isv-rancher-stable.list",
"sudo rm -f /usr/share/keyrings/isv-rancher-stable-archive-keyring.gpg"
)
),
false
)
);
}
Expand Down
Loading