app/status: line wrap RemovedBasePackages

Wrap RemovedBasePackages like other package lists in the status
command so it looks prettier.

fixup! app/status: line wrap RemovedBasePackages

fixup! app/status: line wrap RemovedBasePackages

fixup! app/status: line wrap RemovedBasePackages

Resolves: #1613

Closes: #1632
Approved by: jlebon
This commit is contained in:
Michael Nguyen 2018-10-22 12:58:58 -04:00 committed by Atomic Bot
parent fca01e70b5
commit 50ef17ed95

View File

@ -696,7 +696,7 @@ print_one_deployment (RPMOSTreeSysroot *sysroot_proxy,
g_autoptr(GPtrArray) active_removals = g_ptr_array_new_with_free_func (g_free); g_autoptr(GPtrArray) active_removals = g_ptr_array_new_with_free_func (g_free);
if (origin_base_removals) if (origin_base_removals)
{ {
g_autoptr(GString) str = g_string_new (""); g_autoptr(GPtrArray) active_removals_nevra = g_ptr_array_new_with_free_func (g_free);
const guint n = g_variant_n_children (origin_base_removals); const guint n = g_variant_n_children (origin_base_removals);
for (guint i = 0; i < n; i++) for (guint i = 0; i < n; i++)
{ {
@ -705,14 +705,16 @@ print_one_deployment (RPMOSTreeSysroot *sysroot_proxy,
const char *name, *nevra; const char *name, *nevra;
g_variant_get_child (gv_nevra, 0, "&s", &nevra); g_variant_get_child (gv_nevra, 0, "&s", &nevra);
g_variant_get_child (gv_nevra, 1, "&s", &name); g_variant_get_child (gv_nevra, 1, "&s", &name);
if (str->len)
g_string_append (str, ", ");
g_string_append (str, nevra);
g_ptr_array_add (active_removals, g_strdup (name)); g_ptr_array_add (active_removals, g_strdup (name));
g_ptr_array_add (active_removals_nevra, g_strdup (nevra));
} }
g_ptr_array_add (active_removals, NULL); g_ptr_array_add (active_removals, NULL);
if (str->len) if (active_removals_nevra->len > 0 )
rpmostree_print_kv ("RemovedBasePackages", max_key_len, str->str); {
g_ptr_array_add (active_removals_nevra, NULL);
print_packages("RemovedBasePackages", max_key_len,
(const char *const*)active_removals_nevra->pdata, NULL);
}
} }
/* only print inactive base removal requests in verbose mode */ /* only print inactive base removal requests in verbose mode */