app/status: Tweak output with --booted

Fix `--booted` was printing an extra line after `Deployments:`. While
we're there, also update the section name to `BootedDeployment:` in that
case to be more correct. (We're not printing all the deployments, only
the booted deployment.)

Closes: #1503
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2018-08-13 15:38:01 -04:00 committed by Atomic Bot
parent 45e162fb69
commit 4ccad2f64b
2 changed files with 6 additions and 2 deletions

View File

@ -476,7 +476,7 @@ print_one_deployment (RPMOSTreeSysroot *sysroot_proxy,
g_autoptr(GVariant) signatures =
g_variant_dict_lookup_value (dict, "signatures", G_VARIANT_TYPE ("av"));
if (!first)
if (!first && !opt_only_booted)
g_print ("\n");
g_print ("%s ", is_booted ? libsd_special_glyph (BLACK_CIRCLE) : " ");
@ -890,7 +890,10 @@ print_deployments (RPMOSTreeSysroot *sysroot_proxy,
booted_osname = osname;
}
g_print ("Deployments:\n");
if (opt_only_booted)
g_print ("BootedDeployment:\n");
else
g_print ("Deployments:\n");
/* just unpack this so that each iteration doesn't have to dig for it */
const char *cached_update_deployment_id = NULL;

View File

@ -117,6 +117,7 @@ echo "ok status doesn't require active PAM session"
vm_rpmostree status -b > status.txt
assert_streq $(grep -F -e 'ostree://' status.txt | wc -l) "1"
assert_file_has_content status.txt BootedDeployment:
echo "ok status -b"
# Reload as root https://github.com/projectatomic/rpm-ostree/issues/976