From 8c76381a9785be73c8029cce13995d8cd8a4200b Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 29 Jun 2016 15:07:16 -0400 Subject: [PATCH] daemon: only add base-checksum if pkgs layered The origin might have an empty "requested" key in the "packages" section, which is probably an indication that packages were once added but were then removed. Explicitly check the length of the pkg array in case it's actually empty before adding the base-checksum to the deployment variant. Closes: #371 Approved by: cgwalters --- src/daemon/rpmostreed-deployment-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/rpmostreed-deployment-utils.c b/src/daemon/rpmostreed-deployment-utils.c index 074a5265..ed38a88b 100644 --- a/src/daemon/rpmostreed-deployment-utils.c +++ b/src/daemon/rpmostreed-deployment-utils.c @@ -223,7 +223,7 @@ rpmostreed_deployment_generate_variant (OstreeDeployment *deployment, g_variant_dict_insert (&dict, "osname", "s", osname); g_variant_dict_insert (&dict, "serial", "i", serial); g_variant_dict_insert (&dict, "checksum", "s", csum); - if (origin_packages) + if (origin_packages != NULL && g_strv_length (origin_packages) > 0) { const char *parent = ostree_commit_get_parent (commit); g_assert (parent);