Skip to content

Commit

Permalink
daemon: Adjust signal argument types
Browse files Browse the repository at this point in the history
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 #1646 for
details.
  • Loading branch information
m-blaha committed Sep 5, 2024
1 parent 5fe2eae commit dd04451
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.Base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
A new download has started.
-->
<signal name="download_add_new">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="download_id" type="s" />
<arg name="description" type="s" />
<arg name="total_to_download" type="x" />
Expand All @@ -76,7 +76,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Progress in downloading.
-->
<signal name="download_progress">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="download_id" type="s" />
<arg name="total_to_download" type="x" />
<arg name="downloaded" type="x" />
Expand All @@ -93,7 +93,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Mirror failure during the download.
-->
<signal name="download_mirror_failure">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="download_id" type="s" />
<arg name="message" type="s" />
<arg name="url" type="s" />
Expand All @@ -110,7 +110,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Downloading has ended.
-->
<signal name="download_end">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="download_id" type="s" />
<arg name="transfer_status" type="u" />
<arg name="message" type="s" />
Expand All @@ -128,7 +128,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Request for repository key import confirmation.
-->
<signal name="repo_key_import_request">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="key_id" type="s" />
<arg name="user_ids" type="as" />
<arg name="key_fingerprint" type="s" />
Expand Down
32 changes: 16 additions & 16 deletions dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Overall progress in transaction item processing. Called right before an item is processed.
-->
<signal name="transaction_elem_progress">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="processed" type="t" />
<arg name="total" type="t" />
Expand All @@ -254,7 +254,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Send right before the rpm transaction is run.
-->
<signal name="transaction_before_begin">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="total" type="t" />
</signal>

Expand All @@ -266,7 +266,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Send right after the rpm transaction run finished.
-->
<signal name="transaction_after_complete">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="success" type="b" />
</signal>

Expand All @@ -280,7 +280,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Processing (installation or removal) of the package has started.
-->
<signal name="transaction_action_start">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="action" type="u" />
<arg name="total" type="t" />
Expand All @@ -296,7 +296,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Progress in processing of the package.
-->
<signal name="transaction_action_progress">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="processed" type="t" />
<arg name="total" type="t" />
Expand All @@ -311,7 +311,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Processing of the package has finished.
-->
<signal name="transaction_action_stop">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="total" type="t" />
</signal>
Expand All @@ -325,7 +325,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
The scriptlet has started.
-->
<signal name="transaction_script_start">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="scriptlet_type" type="u" />
</signal>
Expand All @@ -340,7 +340,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
The scriptlet has successfully finished.
-->
<signal name="transaction_script_stop">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="scriptlet_type" type="u" />
<arg name="return_code" type="t" />
Expand All @@ -356,7 +356,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
The scriptlet has finished with an error.
-->
<signal name="transaction_script_error">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
<arg name="scriptlet_type" type="u" />
<arg name="return_code" type="t" />
Expand All @@ -370,7 +370,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Package files verification has started.
-->
<signal name="transaction_verify_start">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="total" type="t" />
</signal>

Expand All @@ -383,7 +383,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Progress in processing of the package.
-->
<signal name="transaction_verify_progress">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="processed" type="t" />
<arg name="total" type="t" />
</signal>
Expand All @@ -396,7 +396,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Package files verification has finished.
-->
<signal name="transaction_verify_stop">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="total" type="t" />
</signal>

Expand All @@ -408,7 +408,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Preparation of transaction packages has started.
-->
<signal name="transaction_transaction_start">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="total" type="t" />
</signal>

Expand All @@ -421,7 +421,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Progress in preparation of transaction packages.
-->
<signal name="transaction_transaction_progress">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="processed" type="t" />
<arg name="total" type="t" />
</signal>
Expand All @@ -434,7 +434,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Preparation of transaction packages has finished.
-->
<signal name="transaction_transaction_stop">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="total" type="t" />
</signal>

Expand All @@ -446,7 +446,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
Error while unpacking the package.
-->
<signal name="transaction_unpack_error">
<arg name="session_object_path" type="o" />
<arg name="session_object_path" type="s" />
<arg name="nevra" type="s" />
</signal>

Expand Down
10 changes: 5 additions & 5 deletions dnf5daemon-server/services/base/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
}

Expand Down
32 changes: 16 additions & 16 deletions dnf5daemon-server/services/rpm/rpm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> get_filter_patterns(dnfdaemon::KeyValueMap options, const std::string & option) {
Expand Down

1 comment on commit dd04451

@mcrha
Copy link
Contributor

@mcrha mcrha commented on dd04451 Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I overlooked this. I found the cause and proposed a different change at #1679 . I do not mind which one "wins". I can remove the first commit from the #1679 if needed.

Please sign in to comment.