core: Tweak package checkout message, update libglnx

The common case is having layered packages and no overrides; seeing
`Applying 8 overlays` then `Building filesystem [0/8]` is redundant.
Tweak the progress to avoid the double message.  Also change the terminology
to clarify that each item is a package.

Also update libglnx to pull in progress bar newline fix.

Update submodule: libglnx

Closes: #1363
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-05-08 09:33:43 -07:00 committed by Atomic Bot
parent 6fbf405be0
commit b03b6a2057
3 changed files with 8 additions and 10 deletions

@ -1 +1 @@
Subproject commit 03e16afa7f2cf7ce517b604035683fa0409f730c Subproject commit 97b5c08d2f93dc93ba296a84bbd2a5ab9bd8fc97

View File

@ -3813,15 +3813,15 @@ rpmostree_context_assemble (RpmOstreeContext *self,
} }
guint overrides_total = overrides_remove->len + overrides_replace->len; guint overrides_total = overrides_remove->len + overrides_replace->len;
const char *progress_msg = "Checking out packages";
if (!layering_on_base) if (!layering_on_base)
{ {
g_assert_cmpint (overrides_total, ==, 0); g_assert_cmpint (overrides_total, ==, 0);
rpmostree_output_message ("Installing %u package%s", overlays->len,
_NS(overlays->len));
} }
else if (overrides_total > 0) else if (overrides_total > 0)
{ {
g_assert (layering_on_base); g_assert (layering_on_base);
progress_msg = "Processing packages";
if (overlays->len > 0) if (overlays->len > 0)
rpmostree_output_message ("Applying %u override%s and %u overlay%s", rpmostree_output_message ("Applying %u override%s and %u overlay%s",
overrides_total, _NS(overrides_total), overrides_total, _NS(overrides_total),
@ -3830,10 +3830,8 @@ rpmostree_context_assemble (RpmOstreeContext *self,
rpmostree_output_message ("Applying %u override%s", overrides_total, rpmostree_output_message ("Applying %u override%s", overrides_total,
_NS(overrides_total)); _NS(overrides_total));
} }
else if (overlays->len > 0) else if (overlays->len > 0)
rpmostree_output_message ("Applying %u overlay%s", overlays->len, ;
_NS(overlays->len));
else else
g_assert_not_reached (); g_assert_not_reached ();
@ -3861,7 +3859,7 @@ rpmostree_context_assemble (RpmOstreeContext *self,
cancellable, error)) cancellable, error))
return FALSE; return FALSE;
n_rpmts_done++; n_rpmts_done++;
rpmostree_output_progress_n_items ("Building filesystem", n_rpmts_done, n_rpmts_elements); rpmostree_output_progress_n_items (progress_msg, n_rpmts_done, n_rpmts_elements);
} }
g_autoptr(GHashTable) files_skip_add = NULL; g_autoptr(GHashTable) files_skip_add = NULL;
@ -3896,7 +3894,7 @@ rpmostree_context_assemble (RpmOstreeContext *self,
dirs_to_remove, cancellable, error)) dirs_to_remove, cancellable, error))
return FALSE; return FALSE;
n_rpmts_done++; n_rpmts_done++;
rpmostree_output_progress_n_items ("Building filesystem", n_rpmts_done, n_rpmts_elements); rpmostree_output_progress_n_items (progress_msg, n_rpmts_done, n_rpmts_elements);
} }
g_clear_pointer (&files_skip_delete, g_hash_table_unref); g_clear_pointer (&files_skip_delete, g_hash_table_unref);
@ -3933,7 +3931,7 @@ rpmostree_context_assemble (RpmOstreeContext *self,
files_skip_add, ovwmode, cancellable, error)) files_skip_add, ovwmode, cancellable, error))
return FALSE; return FALSE;
n_rpmts_done++; n_rpmts_done++;
rpmostree_output_progress_n_items ("Building filesystem", n_rpmts_done, n_rpmts_elements); rpmostree_output_progress_n_items (progress_msg, n_rpmts_done, n_rpmts_elements);
} }
rpmostree_output_progress_end (); rpmostree_output_progress_end ();

View File

@ -93,7 +93,7 @@ echo "ok pkg-add foo"
# Test that we don't do progress bars if on a tty (with the client) # Test that we don't do progress bars if on a tty (with the client)
vm_rpmostree uninstall foo-1.0 vm_rpmostree uninstall foo-1.0
vm_rpmostree install foo-1.0 > foo-install.txt vm_rpmostree install foo-1.0 > foo-install.txt
assert_file_has_content_literal foo-install.txt 'Building filesystem (1/1) 100%' assert_file_has_content_literal foo-install.txt 'Checking out packages (1/1) 100%'
echo "ok install not on a tty" echo "ok install not on a tty"
vm_reboot vm_reboot