Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
PackageKit.20954
PackageKit-zypp-update-packages-in-all-openSUSE...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File PackageKit-zypp-update-packages-in-all-openSUSE.patch of Package PackageKit.20954
From 91c8ffd7cdfb80f48c255e097675db34cc671dc9 Mon Sep 17 00:00:00 2001 From: Jonathan Kang <jonathankang@gnome.org> Date: Wed, 20 Nov 2019 15:13:04 +0800 Subject: [PATCH] zypp: Merge updating function into update-packages No matter whether you are using Tumbleweed or Leap, update-packages is the place where all the action happens. --- backends/zypp/pk-backend-zypp.cpp | 40 ++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp index 861c93ab0..2e582a0e6 100644 --- a/backends/zypp/pk-backend-zypp.cpp +++ b/backends/zypp/pk-backend-zypp.cpp @@ -3414,6 +3414,36 @@ pk_backend_get_packages (PkBackend *backend, PkBackendJob *job, PkBitfield filte pk_backend_job_thread_create (job, backend_get_packages_thread, NULL, NULL); } +static void +upgrade_system (PkBackendJob *job, + ZYpp::Ptr zypp, + PkBitfield transaction_flags) +{ + set<PoolItem> candidates; + + /* refresh the repos before checking for updates. */ + 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, + "No Distribution Upgrade Available."); + + return; + } + + 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); +} + static void backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer user_data) { @@ -3432,9 +3462,7 @@ backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer us } if (is_tumbleweed ()) { - zypp_backend_finished_error (job, - PK_ERROR_ENUM_NOT_SUPPORTED, - "This product requires to be updated by calling 'pkcon upgrade-system'"); + upgrade_system (job, zypp, transaction_flags); return; } @@ -3480,12 +3508,6 @@ backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer us } zypp_perform_execution (job, zypp, UPDATE, FALSE, transaction_flags); - - /* Don't reset upgrade mode if we're simulating the changes. Only reset - * it after the real actions has been done. */ - if (!pk_bitfield_contain (transaction_flags, PK_TRANSACTION_FLAG_ENUM_SIMULATE)) { - zypp->resolver()->setUpgradeMode(FALSE); - } } /** -- 2.24.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor