Skip to content
Merged
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
68 changes: 48 additions & 20 deletions rust/agama-software/src/zypp_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = 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() {
Expand Down
Loading