bin/summary: Fix --raw option
authorDan Nicholson <nicholson@endlessm.com>
Thu, 9 Nov 2017 02:15:11 +0000 (02:15 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 9 Nov 2017 17:15:59 +0000 (17:15 +0000)
I wanted to inspect a summary file the other day and was saddened to
find it was broken:

  $ ostree summary --raw
  error: No option specified; use -u to update summary

Fix the test to do the normal thing of passing just --raw without
--view. It's legal to pass --raw and --view, but it shouldn't be a
requirement.

Closes: #1336
Approved by: cgwalters

src/ostree/ot-builtin-summary.c
tests/test-summary-view.sh

index c6319f15cbac7e6bdd9cc8f1af2b89d4262c9632..ba8f379b7c61690c3d0aef56ea25d9b5f4873709 100644 (file)
@@ -210,7 +210,7 @@ ostree_builtin_summary (int argc, char **argv, OstreeCommandInvocation *invocati
             return FALSE;
         }
     }
-  else if (opt_view)
+  else if (opt_view || opt_raw)
     {
       g_autoptr(GBytes) summary_data = NULL;
 
index 52ac892610d190762cfc21d330227f63bb01e60e..6e4210796d002e8cc1015a855467f4d37565a38f 100755 (executable)
@@ -55,7 +55,7 @@ assert_file_has_content_literal summary.txt "Timestamp (ostree.commit.timestamp)
 echo "ok view summary"
 
 # Check the summary can be viewed raw too.
-${OSTREE} summary --view --raw > raw-summary.txt
+${OSTREE} summary --raw > raw-summary.txt
 assert_file_has_content_literal raw-summary.txt "('main', ("
 assert_file_has_content_literal raw-summary.txt "('other', ("
 assert_file_has_content_literal raw-summary.txt "{'ostree.summary.last-modified': <uint64"