Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:yfjiang:branches:GNOME:STABLE:41
PackageKit
PackageKit-zypp-add-upgrade-system.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File PackageKit-zypp-add-upgrade-system.patch of Package PackageKit
From 74da50015b14f3465042aa7280a8e7721a825540 Mon Sep 17 00:00:00 2001 From: Jonathan Kang <jonathankang@gnome.org> Date: Wed, 4 Aug 2021 14:32:22 +0800 Subject: [PATCH] zypp: implement upgrade-system method --- backends/zypp/pk-backend-zypp.cpp | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp index 6da70348b..49251297d 100644 --- a/backends/zypp/pk-backend-zypp.cpp +++ b/backends/zypp/pk-backend-zypp.cpp @@ -3528,6 +3528,55 @@ pk_backend_update_packages (PkBackend *backend, PkBackendJob *job, PkBitfield tr pk_backend_job_thread_create (job, backend_update_packages_thread, NULL, NULL); } +static void +pk_backend_upgrade_system_thread (PkBackendJob *job, + GVariant *params, + gpointer user_data) +{ + const gchar *release_ver = NULL; + PkBitfield transaction_flags = 0; + + g_variant_get (params, "(t&su)", + &transaction_flags, + &release_ver, NULL); + + ZyppJob zjob(job); + ZYpp::Ptr zypp = zjob.get_zypp (); + if (zypp == NULL) { + return; + } + + if (is_tumbleweed ()) { + pk_backend_job_error_code (job, PK_ERROR_ENUM_NOT_SUPPORTED, + "upgrade-system is not supported in Tumbleweed, use \"pkcon update\" instead."); + return; + } + + ResPool pool = zypp_build_pool (zypp, TRUE); + PkRestartEnum restart = PK_RESTART_ENUM_NONE; + PoolStatusSaver saver; + + /* Set environment variable ZYPP_REPO_RELEASEVER to target version. */ + g_setenv ("ZYPP_REPO_RELEASEVER", release_ver, TRUE); + + upgrade_system (job, zypp, transaction_flags); + + g_unsetenv ("ZYPP_REPO_RELEASEVER"); +} + +/** + * pk_backend_upgrade_system + */ +void +pk_backend_upgrade_system (PkBackend *backend, + PkBackendJob *job, + PkBitfield transaction_flags, + const gchar *distro_id, + PkUpgradeKindEnum upgrade_kind) +{ + pk_backend_job_thread_create (job, pk_backend_upgrade_system_thread, NULL, NULL); +} + static void backend_repo_set_data_thread (PkBackendJob *job, GVariant *params, gpointer user_data) { -- 2.31.1
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