diff --git a/src/daemon/utils.c b/src/daemon/utils.c index 975f6b3e..c1254346 100644 --- a/src/daemon/utils.c +++ b/src/daemon/utils.c @@ -18,6 +18,20 @@ #include "utils.h" +char * +deployment_generate_id (OstreeDeployment *deployment) +{ + const char *osname; + guint hash; + + g_return_val_if_fail (OSTREE_IS_DEPLOYMENT (deployment), NULL); + + osname = ostree_deployment_get_osname (deployment); + hash = ostree_deployment_hash (deployment); + + return g_strdup_printf ("%s_%u", osname, hash); +} + static gboolean handle_cancel_cb (RPMOSTreeTransaction *transaction, GDBusMethodInvocation *invocation, diff --git a/src/daemon/utils.h b/src/daemon/utils.h index 764a6aef..5cffadb9 100644 --- a/src/daemon/utils.h +++ b/src/daemon/utils.h @@ -18,8 +18,12 @@ #pragma once +#include + #include "types.h" +char * deployment_generate_id (OstreeDeployment *deployment); + RPMOSTreeTransaction * new_transaction (GDBusMethodInvocation *invocation, GCancellable *method_cancellable, GError **error);