summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-gpg-sign.c
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-05-05 11:28:42 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2017-05-08 00:55:24 +0000
commitc1290177a312d5f416d7afd43be2c1cfe1a3f7ad (patch)
tree0f49a51246a4333261d1258f2e83e156ea03b0b2 /src/ostree/ot-builtin-gpg-sign.c
parenta946c3d42385d7ab44a01dcf212400cd5df28be3 (diff)
downloadostree-c1290177a312d5f416d7afd43be2c1cfe1a3f7ad.tar.gz
ostree: Use #defines for well-known metadata key names
Rather than hard-coding the names as strings. This makes the code a little more maintainable. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #826 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-builtin-gpg-sign.c')
-rw-r--r--src/ostree/ot-builtin-gpg-sign.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ostree/ot-builtin-gpg-sign.c b/src/ostree/ot-builtin-gpg-sign.c
index 0ef2be8b..e14eba68 100644
--- a/src/ostree/ot-builtin-gpg-sign.c
+++ b/src/ostree/ot-builtin-gpg-sign.c
@@ -26,6 +26,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
+#include "ostree-core-private.h"
static gboolean opt_delete;
static char *opt_gpg_homedir;
@@ -85,7 +86,7 @@ delete_signatures (OstreeRepo *repo,
g_variant_dict_init (&metadata_dict, old_metadata);
signature_data = g_variant_dict_lookup_value (&metadata_dict,
- "ostree.gpgsigs",
+ _OSTREE_METADATA_GPGSIGS_NAME,
G_VARIANT_TYPE ("aay"));
/* Taking the approach of deleting whatever matches we find for the
@@ -154,7 +155,7 @@ delete_signatures (OstreeRepo *repo,
/* Update the metadata dictionary. */
if (g_queue_is_empty (&signatures))
{
- g_variant_dict_remove (&metadata_dict, "ostree.gpgsigs");
+ g_variant_dict_remove (&metadata_dict, _OSTREE_METADATA_GPGSIGS_NAME);
}
else
{
@@ -170,7 +171,7 @@ delete_signatures (OstreeRepo *repo,
}
g_variant_dict_insert_value (&metadata_dict,
- "ostree.gpgsigs",
+ _OSTREE_METADATA_GPGSIGS_NAME,
g_variant_builder_end (&signature_builder));
}