daemon: Add deployment_generate_id() to utils

This commit is contained in:
Matthew Barnes 2015-05-22 14:23:57 -04:00
parent 8f5993e220
commit c2e19fb39e
2 changed files with 18 additions and 0 deletions

View File

@ -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,

View File

@ -18,8 +18,12 @@
#pragma once
#include <ostree.h>
#include "types.h"
char * deployment_generate_id (OstreeDeployment *deployment);
RPMOSTreeTransaction * new_transaction (GDBusMethodInvocation *invocation,
GCancellable *method_cancellable,
GError **error);