From dd04451bfcd1468279f98d6695a9e6a9d987cc72 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Thu, 5 Sep 2024 13:58:15 +0200 Subject: [PATCH] daemon: Adjust signal argument types It looks like the server is sending session_object_path argument as a string, although it is declared as "object path" type. Changing to strings to resolve runtime warnings on the client side. See https://github.com/rpm-software-management/dnf5/issues/1646 for details. --- .../dbus/interfaces/org.rpm.dnf.v0.Base.xml | 10 +++--- .../interfaces/org.rpm.dnf.v0.rpm.Rpm.xml | 32 +++++++++---------- dnf5daemon-server/services/base/base.cpp | 10 +++--- dnf5daemon-server/services/rpm/rpm.cpp | 32 +++++++++---------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.Base.xml b/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.Base.xml index d79fe2fa6..4562996c0 100644 --- a/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.Base.xml +++ b/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.Base.xml @@ -60,7 +60,7 @@ along with libdnf. If not, see . A new download has started. --> - + @@ -76,7 +76,7 @@ along with libdnf. If not, see . Progress in downloading. --> - + @@ -93,7 +93,7 @@ along with libdnf. If not, see . Mirror failure during the download. --> - + @@ -110,7 +110,7 @@ along with libdnf. If not, see . Downloading has ended. --> - + @@ -128,7 +128,7 @@ along with libdnf. If not, see . Request for repository key import confirmation. --> - + diff --git a/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml b/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml index 5df68cd91..735d0154a 100644 --- a/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml +++ b/dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml @@ -240,7 +240,7 @@ along with libdnf. If not, see . Overall progress in transaction item processing. Called right before an item is processed. --> - + @@ -254,7 +254,7 @@ along with libdnf. If not, see . Send right before the rpm transaction is run. --> - + @@ -266,7 +266,7 @@ along with libdnf. If not, see . Send right after the rpm transaction run finished. --> - + @@ -280,7 +280,7 @@ along with libdnf. If not, see . Processing (installation or removal) of the package has started. --> - + @@ -296,7 +296,7 @@ along with libdnf. If not, see . Progress in processing of the package. --> - + @@ -311,7 +311,7 @@ along with libdnf. If not, see . Processing of the package has finished. --> - + @@ -325,7 +325,7 @@ along with libdnf. If not, see . The scriptlet has started. --> - + @@ -340,7 +340,7 @@ along with libdnf. If not, see . The scriptlet has successfully finished. --> - + @@ -356,7 +356,7 @@ along with libdnf. If not, see . The scriptlet has finished with an error. --> - + @@ -370,7 +370,7 @@ along with libdnf. If not, see . Package files verification has started. --> - + @@ -383,7 +383,7 @@ along with libdnf. If not, see . Progress in processing of the package. --> - + @@ -396,7 +396,7 @@ along with libdnf. If not, see . Package files verification has finished. --> - + @@ -408,7 +408,7 @@ along with libdnf. If not, see . Preparation of transaction packages has started. --> - + @@ -421,7 +421,7 @@ along with libdnf. If not, see . Progress in preparation of transaction packages. --> - + @@ -434,7 +434,7 @@ along with libdnf. If not, see . Preparation of transaction packages has finished. --> - + @@ -446,7 +446,7 @@ along with libdnf. If not, see . Error while unpacking the package. --> - + diff --git a/dnf5daemon-server/services/base/base.cpp b/dnf5daemon-server/services/base/base.cpp index 27339bc88..22076cd82 100644 --- a/dnf5daemon-server/services/base/base.cpp +++ b/dnf5daemon-server/services/base/base.cpp @@ -62,27 +62,27 @@ void Base::dbus_register() { dbus_object->registerSignal( dnfdaemon::INTERFACE_BASE, dnfdaemon::SIGNAL_DOWNLOAD_ADD_NEW, - "ossx", + "sssx", {"session_object_path", "download_id", "description", "total_to_download"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_BASE, dnfdaemon::SIGNAL_DOWNLOAD_PROGRESS, - "osxx", + "ssxx", {"session_object_path", "download_id", "total_to_download", "downloaded"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_BASE, dnfdaemon::SIGNAL_DOWNLOAD_END, - "osus", + "ssus", {"session_object_path", "download_id", "transfer_status", "message"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_BASE, dnfdaemon::SIGNAL_DOWNLOAD_MIRROR_FAILURE, - "ossss", + "sssss", {"session_object_path", "download_id", "message", "url", "metadata"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_BASE, dnfdaemon::SIGNAL_REPO_KEY_IMPORT_REQUEST, - "osasssx", + "ssasssx", {"session_object_path", "key_id", "user_ids", "key_fingerprint", "key_url", "timestamp"}); } diff --git a/dnf5daemon-server/services/rpm/rpm.cpp b/dnf5daemon-server/services/rpm/rpm.cpp index 2a8ff695c..39fe89117 100644 --- a/dnf5daemon-server/services/rpm/rpm.cpp +++ b/dnf5daemon-server/services/rpm/rpm.cpp @@ -125,73 +125,73 @@ void Rpm::dbus_register() { }); dbus_object->registerSignal( - dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_BEFORE_BEGIN, "ot", {"session_object_path", "total"}); + dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_BEFORE_BEGIN, "st", {"session_object_path", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_AFTER_COMPLETE, - "ob", + "sb", {"session_object_path", "success"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_ELEM_PROGRESS, - "ostt", + "sstt", {"session_object_path", "nevra", "processed", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_ACTION_START, - "osut", + "ssut", {"session_object_path", "nevra", "action", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_ACTION_PROGRESS, - "ostt", + "sstt", {"session_object_path", "nevra", "processed", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_ACTION_STOP, - "ost", + "sst", {"session_object_path", "nevra", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_SCRIPT_START, - "osu", + "ssu", {"session_object_path", "nevra", "scriptlet_type"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_SCRIPT_STOP, - "osut", + "ssut", {"session_object_path", "nevra", "scriptlet_type", "return_code"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_SCRIPT_ERROR, - "osut", + "ssut", {"session_object_path", "nevra", "scriptlet_type", "return_code"}); dbus_object->registerSignal( - dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_VERIFY_START, "ot", {"session_object_path", "total"}); + dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_VERIFY_START, "st", {"session_object_path", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_VERIFY_PROGRESS, - "ott", + "stt", {"session_object_path", "processed", "total"}); dbus_object->registerSignal( - dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_VERIFY_STOP, "ot", {"session_object_path", "total"}); + dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_VERIFY_STOP, "st", {"session_object_path", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_TRANSACTION_START, - "ot", + "st", {"session_object_path", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_TRANSACTION_PROGRESS, - "ott", + "stt", {"session_object_path", "processed", "total"}); dbus_object->registerSignal( dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_TRANSACTION_STOP, - "ot", + "st", {"session_object_path", "total"}); dbus_object->registerSignal( - dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_UNPACK_ERROR, "os", {"session_object_path", "nevra"}); + dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_UNPACK_ERROR, "ss", {"session_object_path", "nevra"}); } std::vector get_filter_patterns(dnfdaemon::KeyValueMap options, const std::string & option) {