diff --git a/rust/agama-software/src/zypp_server.rs b/rust/agama-software/src/zypp_server.rs index 929c5d81f4..ee2e33ecd9 100644 --- a/rust/agama-software/src/zypp_server.rs +++ b/rust/agama-software/src/zypp_server.rs @@ -418,31 +418,59 @@ impl ZyppServer { // reset everything to start from scratch zypp.reset_resolvables(); + // FIXME: hotfix/workaround for bsc#1259311 - check if a *-release package is selected to install + // and if so then do not select the product to install, this should be removed after fixing the solver + let mut selected_release_package: Option = None; + for (name, r#type, selection) in &state.resolvables.to_vec() { + if r#type == &ResolvableType::Package + && name.ends_with("-release") + // uh, the "lsb-release" package actually does not provide any product... + && name != "lsb-release" + { + match selection { + ResolvableSelection::Selected | ResolvableSelection::AutoSelected { .. } => { + selected_release_package = Some(name.clone()); + break; + } + ResolvableSelection::Removed => {} + } + } + } + _ = progress.cast(progress::message::Next::new(Scope::Software)); - let result = zypp.select_resolvable( - &state.product, - zypp_agama::ResolvableKind::Product, - zypp_agama::ResolvableSelected::Installation, - ); - if let Err(error) = result { + if let Some(release_package) = selected_release_package { tracing::info!( - "Failed to find the product {} in the repositories: {}", + "Release package {} will be installed, not selecting the product {} to install", + release_package, + &state.product + ); + } else { + tracing::info!("Selecting base product: {}", &state.product); + let result = zypp.select_resolvable( &state.product, - &error + zypp_agama::ResolvableKind::Product, + zypp_agama::ResolvableSelected::Installation, ); - if state.allow_registration && !self.is_registered() { - let message = gettext("Failed to find the product in the repositories. You might need to register the system."); - let issue = - Issue::new("missing_registration", &message).with_details(&error.to_string()); - issues.product.push(issue); - } else { - let message = gettext("Failed to find the product in the repositories."); - let issue = - Issue::new("missing_product", &message).with_details(&error.to_string()); - issues.software.push(issue); - }; + if let Err(error) = result { + tracing::info!( + "Failed to find the product {} in the repositories: {}", + &state.product, + &error + ); + if state.allow_registration && !self.is_registered() { + let message = gettext("Failed to find the product in the repositories. You might need to register the system."); + let issue = Issue::new("missing_registration", &message) + .with_details(&error.to_string()); + issues.product.push(issue); + } else { + let message = gettext("Failed to find the product in the repositories."); + let issue = + Issue::new("missing_product", &message).with_details(&error.to_string()); + issues.software.push(issue); + }; - return Self::send_issues_and_finish(issues, tx, progress); + return Self::send_issues_and_finish(issues, tx, progress); + } } for (name, r#type, selection) in &state.resolvables.to_vec() {