Accepting request 978286 from GNOME:Next

Tweak .changes, resub

OBS-URL: https://build.opensuse.org/request/show/978286
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/PackageKit?expand=0&rev=428
This commit is contained in:
Dominique Leuenberger 2022-05-23 09:06:03 +00:00 committed by Git OBS Bridge
parent 155eef0fb0
commit d9f907b892
9 changed files with 45 additions and 401 deletions

335
505.patch
View File

@ -1,335 +0,0 @@
From 02354c3a339b7f8d6661731f224e7ccf1fc34ddc Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Mon, 13 Sep 2021 19:57:12 +0200
Subject: [PATCH] pk-offline: Add flags to D-Bus invoking methods
That's currently to be able to set whether the method should be
interactive or not. The old functions call the methods as non-interactive.
Closes https://github.com/PackageKit/PackageKit/issues/504
---
client/pk-console.c | 4 +-
docs/api/PackageKit-sections.txt | 4 +
lib/packagekit-glib2/pk-offline.c | 104 ++++++++++++++++++++++++--
lib/packagekit-glib2/pk-offline.h | 31 ++++++++
lib/packagekit-glib2/pk-test-daemon.c | 4 +-
5 files changed, 138 insertions(+), 9 deletions(-)
diff --git a/client/pk-console.c b/client/pk-console.c
index 3d027e601..4fd620fec 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -2283,14 +2283,14 @@ main (int argc, char *argv[])
} else if (strcmp (mode, "offline-trigger") == 0) {
run_mainloop = FALSE;
- ret = pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, &error);
+ ret = pk_offline_trigger_with_flags (PK_OFFLINE_ACTION_REBOOT, PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error);
if (!ret)
ctx->retval = error->code;
} else if (strcmp (mode, "offline-cancel") == 0) {
run_mainloop = FALSE;
- ret = pk_offline_cancel (NULL, &error);
+ ret = pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error);
if (!ret)
ctx->retval = error->code;
diff --git a/docs/api/PackageKit-sections.txt b/docs/api/PackageKit-sections.txt
index ead052f92..2020bd65d 100644
--- a/docs/api/PackageKit-sections.txt
+++ b/docs/api/PackageKit-sections.txt
@@ -525,9 +525,13 @@ pk_offline_get_action_monitor
pk_offline_get_results
pk_offline_get_results_mtime
pk_offline_cancel
+pk_offline_cancel_with_flags
pk_offline_clear_results
+pk_offline_clear_results_with_flags
pk_offline_trigger
+pk_offline_trigger_with_flags
pk_offline_trigger_upgrade
+pk_offline_trigger_upgrade_with_flags
</SECTION>
<SECTION>
diff --git a/lib/packagekit-glib2/pk-offline.c b/lib/packagekit-glib2/pk-offline.c
index 2e3870580..9030be293 100644
--- a/lib/packagekit-glib2/pk-offline.c
+++ b/lib/packagekit-glib2/pk-offline.c
@@ -95,6 +95,14 @@ pk_offline_action_from_string (const gchar *action)
return PK_OFFLINE_ACTION_UNKNOWN;
}
+static GDBusCallFlags
+pk_offline_flags_to_gdbus_call_flags (PkOfflineFlags flags)
+{
+ if ((flags & PK_OFFLINE_FLAGS_INTERACTIVE) != 0)
+ return G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION;
+ return G_DBUS_CALL_FLAGS_NONE;
+}
+
/**
* pk_offline_cancel:
* @cancellable: A #GCancellable or %NULL
@@ -102,6 +110,8 @@ pk_offline_action_from_string (const gchar *action)
*
* Cancels the offline operation that has been scheduled. If there is no
* scheduled offline operation then this method returns with success.
+ * The function always allows user interaction. To change the behavior,
+ * use pk_offline_cancel_with_flags().
*
* Return value: %TRUE for success, else %FALSE and @error set
*
@@ -109,6 +119,25 @@ pk_offline_action_from_string (const gchar *action)
**/
gboolean
pk_offline_cancel (GCancellable *cancellable, GError **error)
+{
+ return pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error);
+}
+
+/**
+ * pk_offline_cancel_with_flags:
+ * @flags: bit-or of #PkOfflineFlags
+ * @cancellable: A #GCancellable or %NULL
+ * @error: A #GError or %NULL
+ *
+ * Cancels the offline operation that has been scheduled. If there is no
+ * scheduled offline operation then this method returns with success.
+ *
+ * Return value: %TRUE for success, else %FALSE and @error set
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+pk_offline_cancel_with_flags (PkOfflineFlags flags, GCancellable *cancellable, GError **error)
{
g_autoptr(GDBusConnection) connection = NULL;
g_autoptr(GVariant) res = NULL;
@@ -125,7 +154,7 @@ pk_offline_cancel (GCancellable *cancellable, GError **error)
"Cancel",
NULL,
NULL,
- G_DBUS_CALL_FLAGS_NONE,
+ pk_offline_flags_to_gdbus_call_flags (flags),
-1,
cancellable,
error);
@@ -139,8 +168,10 @@ pk_offline_cancel (GCancellable *cancellable, GError **error)
* @cancellable: A #GCancellable or %NULL
* @error: A #GError or %NULL
*
- * Crears the last offline operation report, which may be success or failure.
+ * Clears the last offline operation report, which may be success or failure.
* If the report does not exist then this method returns success.
+ * The function always allows user interaction. To change the behavior,
+ * use pk_offline_clear_results_with_flags().
*
* Return value: %TRUE for success, else %FALSE and @error set
*
@@ -148,6 +179,25 @@ pk_offline_cancel (GCancellable *cancellable, GError **error)
**/
gboolean
pk_offline_clear_results (GCancellable *cancellable, GError **error)
+{
+ return pk_offline_clear_results_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error);
+}
+
+/**
+ * pk_offline_clear_results_with_flags:
+ * @flags: bit-or of #PkOfflineFlags
+ * @cancellable: A #GCancellable or %NULL
+ * @error: A #GError or %NULL
+ *
+ * Clears the last offline operation report, which may be success or failure.
+ * If the report does not exist then this method returns success.
+ *
+ * Return value: %TRUE for success, else %FALSE and @error set
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+pk_offline_clear_results_with_flags (PkOfflineFlags flags, GCancellable *cancellable, GError **error)
{
g_autoptr(GDBusConnection) connection = NULL;
g_autoptr(GVariant) res = NULL;
@@ -164,7 +214,7 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error)
"ClearResults",
NULL,
NULL,
- G_DBUS_CALL_FLAGS_NONE,
+ pk_offline_flags_to_gdbus_call_flags (flags),
-1,
cancellable,
error);
@@ -181,6 +231,8 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error)
*
* Triggers the offline update so that the next reboot will perform the
* pending transaction.
+ * The function always allows user interaction. To change the behavior,
+ * use pk_offline_trigger_with_flags().
*
* Return value: %TRUE for success, else %FALSE and @error set
*
@@ -188,6 +240,26 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error)
**/
gboolean
pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError **error)
+{
+ return pk_offline_trigger_with_flags (action, PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error);
+}
+
+/**
+ * pk_offline_trigger_with_flags:
+ * @action: a #PkOfflineAction, e.g. %PK_OFFLINE_ACTION_REBOOT
+ * @flags: bit-or of #PkOfflineFlags
+ * @cancellable: A #GCancellable or %NULL
+ * @error: A #GError or %NULL
+ *
+ * Triggers the offline update so that the next reboot will perform the
+ * pending transaction.
+ *
+ * Return value: %TRUE for success, else %FALSE and @error set
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+pk_offline_trigger_with_flags (PkOfflineAction action, PkOfflineFlags flags, GCancellable *cancellable, GError **error)
{
const gchar *tmp;
g_autoptr(GDBusConnection) connection = NULL;
@@ -206,7 +278,7 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError **
"Trigger",
g_variant_new ("(s)", tmp),
NULL,
- G_DBUS_CALL_FLAGS_NONE,
+ pk_offline_flags_to_gdbus_call_flags (flags),
-1,
cancellable,
error);
@@ -223,6 +295,8 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError **
*
* Triggers the offline system upgrade so that the next reboot will perform the
* pending transaction.
+ * The function always allows user interaction. To change the behavior,
+ * use pk_offline_trigger_upgrade_with_flags().
*
* Return value: %TRUE for success, else %FALSE and @error set
*
@@ -230,6 +304,26 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError **
**/
gboolean
pk_offline_trigger_upgrade (PkOfflineAction action, GCancellable *cancellable, GError **error)
+{
+ return pk_offline_trigger_upgrade_with_flags (action, PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error);
+}
+
+/**
+ * pk_offline_trigger_upgrade_with_flags:
+ * @action: a #PkOfflineAction, e.g. %PK_OFFLINE_ACTION_REBOOT
+ * @flags: bit-or of #PkOfflineFlags
+ * @cancellable: A #GCancellable or %NULL
+ * @error: A #GError or %NULL
+ *
+ * Triggers the offline system upgrade so that the next reboot will perform the
+ * pending transaction.
+ *
+ * Return value: %TRUE for success, else %FALSE and @error set
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+pk_offline_trigger_upgrade_with_flags (PkOfflineAction action, PkOfflineFlags flags, GCancellable *cancellable, GError **error)
{
const gchar *tmp;
g_autoptr(GDBusConnection) connection = NULL;
@@ -248,7 +342,7 @@ pk_offline_trigger_upgrade (PkOfflineAction action, GCancellable *cancellable, G
"TriggerUpgrade",
g_variant_new ("(s)", tmp),
NULL,
- G_DBUS_CALL_FLAGS_NONE,
+ pk_offline_flags_to_gdbus_call_flags (flags),
-1,
cancellable,
error);
diff --git a/lib/packagekit-glib2/pk-offline.h b/lib/packagekit-glib2/pk-offline.h
index e85179823..943e9a13b 100644
--- a/lib/packagekit-glib2/pk-offline.h
+++ b/lib/packagekit-glib2/pk-offline.h
@@ -71,6 +71,21 @@ typedef enum
PK_OFFLINE_ERROR_LAST
} PkOfflineError;
+/**
+ * PkOfflineFlags:
+ * @PK_OFFLINE_FLAGS_NONE: No specific flag
+ * @PK_OFFLINE_FLAGS_INTERACTIVE: Run the action in an interactive mode, allowing polkit authentication dialogs
+ *
+ * Flags to be used for the method invocations.
+ *
+ * Since: 1.2.5
+ */
+typedef enum
+{
+ PK_OFFLINE_FLAGS_NONE = 0,
+ PK_OFFLINE_FLAGS_INTERACTIVE = 1 << 0
+} PkOfflineFlags;
+
GQuark pk_offline_error_quark (void);
const gchar *pk_offline_action_to_string (PkOfflineAction action);
PkOfflineAction pk_offline_action_from_string (const gchar *action);
@@ -92,14 +107,30 @@ PkResults *pk_offline_get_results (GError **error);
guint64 pk_offline_get_results_mtime (GError **error);
gboolean pk_offline_cancel (GCancellable *cancellable,
GError **error);
+gboolean pk_offline_cancel_with_flags (PkOfflineFlags flags,
+ GCancellable *cancellable,
+ GError **error);
gboolean pk_offline_clear_results (GCancellable *cancellable,
GError **error);
+gboolean pk_offline_clear_results_with_flags
+ (PkOfflineFlags flags,
+ GCancellable *cancellable,
+ GError **error);
gboolean pk_offline_trigger (PkOfflineAction action,
GCancellable *cancellable,
GError **error);
+gboolean pk_offline_trigger_with_flags (PkOfflineAction action,
+ PkOfflineFlags flags,
+ GCancellable *cancellable,
+ GError **error);
gboolean pk_offline_trigger_upgrade (PkOfflineAction action,
GCancellable *cancellable,
GError **error);
+gboolean pk_offline_trigger_upgrade_with_flags
+ (PkOfflineAction action,
+ PkOfflineFlags flags,
+ GCancellable *cancellable,
+ GError **error);
G_END_DECLS
diff --git a/lib/packagekit-glib2/pk-test-daemon.c b/lib/packagekit-glib2/pk-test-daemon.c
index efa762077..b2917b07d 100644
--- a/lib/packagekit-glib2/pk-test-daemon.c
+++ b/lib/packagekit-glib2/pk-test-daemon.c
@@ -154,7 +154,7 @@ pk_test_offline_func (void)
g_assert_cmpstr (data, ==, "powertop;1.8-1.fc8;i386;fedora");
/* trigger */
- ret = pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, &error);
+ ret = pk_offline_trigger_with_flags (PK_OFFLINE_ACTION_REBOOT, PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error);
g_assert_no_error (error);
g_assert (ret);
g_assert (g_file_test (PK_OFFLINE_PREPARED_FILENAME, G_FILE_TEST_EXISTS));
@@ -163,7 +163,7 @@ pk_test_offline_func (void)
g_assert (!g_file_test (PK_OFFLINE_RESULTS_FILENAME, G_FILE_TEST_EXISTS));
/* cancel the trigger */
- ret = pk_offline_cancel (NULL, &error);
+ ret = pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error);
g_assert_no_error (error);
g_assert (ret);
g_assert (g_file_test (PK_OFFLINE_PREPARED_FILENAME, G_FILE_TEST_EXISTS));

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f262a1ed7ac19eb1a40bf8509d61de7be578f8543459b5ec0b2414463cce45b8
size 2748656

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEFj61ARkiXbPfj0nqF6y6jfqXDhcFAmEDt54ACgkQF6y6jfqX
Dhcaywf9F2ti/Keqhoa2qZ0gvOkPmhRuayrV/7lMqb+qFrHkxfUb2XhcPYb7jABm
Q+nA05YVM3gViIMVOgu8ltVQLaK8/YZLebZcV49jdmNRqvPVtBsyXzE9tR8I8jwE
KQNLGulLXRsSF5zE2fj9a4FCDtjAJ2NjYyu9QdLXk2DEHG2G9+nHKPmF1oY7TF13
JqLjUyWnyDG5xNsY55QIwV3LVrFYE4B7zKr2qcqJWSCJWsOEziy6xirSNOQRwgmH
Hl7e7qfFdG+XSacnCcBx6qUG5X4WzFX+eQ8jx/vBX5J735mS0syUScljC1moq+k4
h1+gdK60PHzGyTEYvAnJUS9Wg6+YaA==
=WCIl
-----END PGP SIGNATURE-----

3
PackageKit-1.2.5.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e08cb9164700ac684386e4257f783493ebac637141d34a8ce8077147ea10ad26
size 2753668

View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEFj61ARkiXbPfj0nqF6y6jfqXDhcFAmIOSzUACgkQF6y6jfqX
Dhcr5Af/W+F5ao9B4d9fulddpqjK70AE6vJdlYCKzj5GprMM5IaNRZL/AeLGweDR
Pt9nWP8SByrMs+yq2IU4FfvpX1iIHcJuTG6ROQdhEkQ9hUAEcFKYGFwMtr7CkMTE
/kgH05QmkvybpRj1JDo4VlOCpjNz5GUvObtzN3M88/5PHKWBopJOo/H4cjS9eppG
cB4DlYjQM8oHFHV3Dy80EX1F6nNX58g0QzzlhWhifffneNR0EDNZNOkVzbyTcjX/
gtMpvvBHdpXZtyN/DGZvzBNciHU8rY3QLVmNCeFIzwcZImwPHgC4PJVWCxOvzBGt
WI6/vLppH1gk8DB8hjagGWB1rBUcWQ==
=9tBL
-----END PGP SIGNATURE-----

View File

@ -1,14 +0,0 @@
Index: PackageKit-1.2.2/backends/zypp/meson.build
===================================================================
--- PackageKit-1.2.2.orig/backends/zypp/meson.build
+++ PackageKit-1.2.2/backends/zypp/meson.build
@@ -22,7 +22,8 @@ shared_module(
'-DG_LOG_DOMAIN="PackageKit-Zypp"',
'-Wall',
'-Woverloaded-virtual',
- '-Wnon-virtual-dtor'
+ '-Wnon-virtual-dtor',
+ '-std=c++1z'
],
c_args: [
'-Wno-deprecated',

View File

@ -1,30 +0,0 @@
From 21ccf49464630cb9da7792d375f472c53717eecb Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathankang@gnome.org>
Date: Thu, 12 Aug 2021 14:39:26 +0800
Subject: [PATCH] zypp: Fix crash when search string is NULL
https://bugzilla.suse.com/show_bug.cgi?id=1179287
---
backends/zypp/pk-backend-zypp.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 6da70348b..fca8ac032 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -3088,6 +3088,12 @@ backend_find_packages_thread (PkBackendJob *job, GVariant *params, gpointer user
&_filters,
&values);
+ if (values == NULL && values[0] == NULL) {
+ pk_backend_job_error_code (job, PK_ERROR_ENUM_PACKAGE_ID_INVALID,
+ "Empty search string is not supported.");
+ return;
+ }
+
ZyppJob zjob(job);
ZYpp::Ptr zypp = zjob.get_zypp();
--
2.31.1

View File

@ -1,3 +1,32 @@
-------------------------------------------------------------------
Fri May 20 09:01:45 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Update to version 1.2.5:
+ Backends:
- dnf:
. Add support for autoremove flag when removing packages.
. Searches by name and package details should be case
insensitive.
. Update appstream xml files if dnf_sack_add_repos() does
the download.
- zypp:
. Add -std=c++1z cpp flags.
. Fix crash when search string is NULL.
. Fix package installation using undefined data.
- Changes to alpm, apttcc, nix, and slack.
+ Bugfixes:
- Install offline-update enablement symlink if Meson is new
enough.
- Move Wants= line for network-online.target.
- Add flags to D-Bus offline invoking methods.
- Properly handle allow-reinstall flag for installations.
- Provide better error message if trying to install an
installed package.
- Wait until online to activate systemd service.
- Drop 505.patch, PackageKit-zypp-c++17.patch, and
PackageKit-zypp-fix-crash-with-empty-search-string.patch: fixed
upstream.
-------------------------------------------------------------------
Tue Nov 16 14:24:11 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package PackageKit
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -32,7 +32,7 @@
%endif
Name: PackageKit
Version: 1.2.4
Version: 1.2.5
Release: 0
Summary: Simple software installation management software
License: GPL-2.0-or-later
@ -50,14 +50,8 @@ Patch1: PackageKit-systemd-timers.patch
Patch2: PackageKit-remove-polkit-rules.patch
# PATCH-FIX-OPENSUSE PackageKit-dnf-Add-support-for-AppStream-repodata-basenames-use.patch ngompa13@gmail.com -- Band-aid to deal with OBS producing differently named appstream repodata files
Patch3: PackageKit-dnf-Add-support-for-AppStream-repodata-basenames-use.patch
# PATCH-FIX-UPSTREAM 505.patch -- pk-offline: Add flags to D-Bus invoking methods
Patch4: https://patch-diff.githubusercontent.com/raw/PackageKit/PackageKit/pull/505.patch
# PATCH-FIX-UPSTREAM PackageKit-fix-crash-pre-dbus.patch gh#hughsie/PackageKit!436 -- Do not crash when calling pk_dbus_get_uid() before D-Bus is setup
Patch5: PackageKit-fix-crash-pre-dbus.patch
# PATCH-FIX-UPSTREAM PackageKit-zypp-fix-crash-with-empty-search-string.patch gh#hughsie/PackageKit/commit#21ccf49, bsc#1179287 sckang@suse.com -- zypp: Fix crash when search string is NULL
Patch6: PackageKit-zypp-fix-crash-with-empty-search-string.patch
# PATCH-FIX-SLE PackageKit-zypp-c++17.patch gh#hughsie/PackageKit/commit/1a6bb6ae6, bsc#1192349 sckang@suse.com -- Fix build failure when building with libzypp > 17.28.5 and gcc < 11.
Patch1000: PackageKit-zypp-c++17.patch
BuildRequires: fdupes
BuildRequires: gcc-c++