summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Kang <jonathankang@gnome.org>2020-05-26 09:31:30 +0800
committerJonathan Kang <jonathankang@gnome.org>2020-05-26 09:31:30 +0800
commit5c0fd7d71eb02450b6644fa0456eab90fcdc823c (patch)
treec20d3fef0e70780f01eb01790de8076f5b771388
parentcfa17a651e1fb6b99285f04fe636cde96d485ea0 (diff)
zypp: Ensure ResPool is built before is_tumbleweed()
Previously, in offline updates Tumbleweed is not identified as Tumbleweed so that updates often fail. Fix that by building ResPool before the condition check.
-rw-r--r--backends/zypp/pk-backend-zypp.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 62b78ec0c..2c1250331 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -3421,7 +3421,6 @@ upgrade_system (PkBackendJob *job,
if (!zypp_refresh_cache (job, zypp, FALSE)) {
return;
}
- zypp_build_pool (zypp, TRUE);
zypp_get_updates (job, zypp, candidates);
if (candidates.empty ()) {
pk_backend_job_error_code (job, PK_ERROR_ENUM_NO_DISTRO_UPGRADE_DATA,
@@ -3433,8 +3432,6 @@ upgrade_system (PkBackendJob *job,
zypp->resolver ()->dupSetAllowVendorChange (ZConfig::instance ().solver_dupAllowVendorChange ());
zypp->resolver ()->doUpgrade ();
- PoolStatusSaver saver;
-
zypp_perform_execution (job, zypp, UPGRADE_SYSTEM, FALSE, transaction_flags);
zypp->resolver ()->setUpgradeMode (FALSE);
@@ -3457,16 +3454,15 @@ backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer us
return;
}
+ ResPool pool = zypp_build_pool (zypp, TRUE);
+ PkRestartEnum restart = PK_RESTART_ENUM_NONE;
+ PoolStatusSaver saver;
+
if (is_tumbleweed ()) {
upgrade_system (job, zypp, transaction_flags);
return;
}
- ResPool pool = zypp_build_pool (zypp, TRUE);
- PkRestartEnum restart = PK_RESTART_ENUM_NONE;
-
- PoolStatusSaver saver;
-
for (guint i = 0; package_ids[i]; i++) {
sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);