ostree/dump: Improve formatting for well-known commit metadata keys

This follows on from commit a946c3d4, which added formatting for
well-known summary metadata keys. This commit adds it for commits.

Currently, the only well-known commit metadata key is
ostree.commit.timestamp. Formatting this correctly is especially
important, since it’s a big-endian uint64, which is completely unusable
for mere mortals when presented as a number rather than a date.

Non-formatted output can still be retrieved using the OSTREE_DUMP_RAW
flag, and the non-formatted key name is always printed for clarity.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #911
Approved by: cgwalters
This commit is contained in:
Philip Withnall authored and Atomic Bot committed 2017-06-07 16:55:35 +00:00
1 parent 87413ee63b
commit 7ce6777028
2 files changed
+31 -14

No files matched your search

+1
View File
@@ -52,6 +52,7 @@ assert_file_has_content_literal summary.txt "* main"
assert_file_has_content_literal summary.txt "* other"
assert_file_has_content_literal summary.txt "ostree.summary.last-modified"
assert_file_has_content_literal summary.txt "Static Deltas (ostree.static-deltas): {}"
assert_file_has_content_literal summary.txt "Timestamp (ostree.commit.timestamp): "
echo "ok view summary"
# Check the summary can be viewed raw too.