lib/sysroot: fix placement for not-default deployment
authorGuy Shapiro <guy.shapiro@mobi-wize.com>
Mon, 21 Aug 2017 06:42:48 +0000 (09:42 +0300)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 21 Aug 2017 16:52:13 +0000 (16:52 +0000)
When using the
OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT flag, the
deployment is said to be added after the booted or merge deployment.
Fix the condition to do so instead of adding it in the second place.

Closes: #1097
Approved by: cgwalters

src/libostree/ostree-sysroot.c

index 86a4f37a9e9bd422cfb8106b8439117ae6d612f6..e6471ab57191b51c1b4c8e54fdef633c987d8e27 100644 (file)
@@ -1545,7 +1545,7 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot      *sysroot,
           g_ptr_array_add (new_deployments, g_object_ref (deployment));
         }
 
-      if (!added_new)
+      if ((!added_new) && is_merge_or_booted)
         {
           g_ptr_array_add (new_deployments, g_object_ref (new_deployment));
           added_new = TRUE;