D-Bus: enable fd passing for deploy/rebase/upgrade

This is the same change that was done for PkgChange(). It will be
required if we want to support specifying local packages through e.g.
--install switches.

Closes: #704
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2017-03-23 14:21:44 -04:00 committed by Atomic Bot
parent 60fcb729e0
commit d592c1874c
5 changed files with 20 additions and 8 deletions

View File

@ -120,7 +120,9 @@ rpmostree_builtin_deploy (int argc,
if (!rpmostree_os_call_deploy_sync (os_proxy,
revision,
get_args_variant (),
NULL,
&transaction_address,
NULL,
cancellable,
error))
goto out;

View File

@ -103,7 +103,9 @@ rpmostree_builtin_rebase (int argc,
get_args_variant (revision),
new_provided_refspec,
packages,
NULL,
&transaction_address,
NULL,
cancellable,
error))
goto out;

View File

@ -122,7 +122,9 @@ rpmostree_builtin_upgrade (int argc,
{
if (!rpmostree_os_call_upgrade_sync (os_proxy,
get_args_variant (),
NULL,
&transaction_address,
NULL,
cancellable,
error))
goto out;

View File

@ -97,6 +97,7 @@
<arg type="s" name="revision" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="s" name="transaction_address" direction="out"/>
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
</method>
<!-- details dictionary keys:
@ -127,6 +128,7 @@
<method name="Upgrade">
<arg type="a{sv}" name="options" direction="in"/>
<arg type="s" name="transaction_address" direction="out"/>
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
</method>
<!-- details dictionary keys:
@ -173,6 +175,7 @@
<arg type="s" name="refspec"/>
<arg type="as" name="packages"/>
<arg type="s" name="transaction_address" direction="out"/>
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
</method>
<!-- details dictionary keys:

View File

@ -392,6 +392,7 @@ deploy_flags_from_options (GVariant *options,
static gboolean
os_handle_deploy (RPMOSTreeOS *interface,
GDBusMethodInvocation *invocation,
GUnixFDList *fdlist,
const char *arg_revision,
GVariant *arg_options)
{
@ -437,7 +438,7 @@ out:
{
const char *client_address;
client_address = rpmostreed_transaction_get_client_address (transaction);
rpmostree_os_complete_deploy (interface, invocation, client_address);
rpmostree_os_complete_deploy (interface, invocation, NULL, client_address);
}
return TRUE;
@ -446,6 +447,7 @@ out:
static gboolean
os_handle_upgrade (RPMOSTreeOS *interface,
GDBusMethodInvocation *invocation,
GUnixFDList *fdlist,
GVariant *arg_options)
{
RpmostreedOS *self = RPMOSTREED_OS (interface);
@ -487,7 +489,7 @@ out:
{
const char *client_address;
client_address = rpmostreed_transaction_get_client_address (transaction);
rpmostree_os_complete_upgrade (interface, invocation, client_address);
rpmostree_os_complete_upgrade (interface, invocation, NULL, client_address);
}
return TRUE;
@ -620,6 +622,7 @@ out:
static gboolean
os_handle_rebase (RPMOSTreeOS *interface,
GDBusMethodInvocation *invocation,
GUnixFDList *fdlist,
GVariant *arg_options,
const char *arg_refspec,
const char * const *arg_packages)
@ -676,7 +679,7 @@ out:
{
const char *client_address;
client_address = rpmostreed_transaction_get_client_address (transaction);
rpmostree_os_complete_rebase (interface, invocation, client_address);
rpmostree_os_complete_rebase (interface, invocation, NULL, client_address);
}
return TRUE;
@ -684,11 +687,11 @@ out:
static gboolean
os_handle_pkg_change (RPMOSTreeOS *interface,
GDBusMethodInvocation *invocation,
GUnixFDList *fdlist,
GVariant *arg_options,
const char * const *arg_packages_added,
const char * const *arg_packages_removed)
GDBusMethodInvocation *invocation,
GUnixFDList *fdlist,
GVariant *arg_options,
const char * const *arg_packages_added,
const char * const *arg_packages_removed)
{
RpmostreedOS *self = RPMOSTREED_OS (interface);
glnx_unref_object RpmostreedTransaction *transaction = NULL;