From 953c9bac420a83d6a384c024cfec2ab3b096cdea Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 10 Apr 2008 18:10:03 -0700 Subject: [PATCH] Squeeze extra blank lines when dumping metadata logs. In lbs-util, squeeze out extra blank lines in the output of the read-metadata command. Extra blank lines may appear in the input, particularly when delta-encoding metadata logs, but to produce uniform-looking outputs, delete these extra blank lines. --- lbs-util | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lbs-util b/lbs-util index d617705..942a601 100755 --- a/lbs-util +++ b/lbs-util @@ -126,7 +126,13 @@ def cmd_read_metadata(snapshot): d = lbs.parse_full(store.load_snapshot(snapshot)) check_version(d['Format']) metadata = lbs.read_metadata(store, d['Root']) + blank = True for l in metadata: + if l == '\n': + if blank: continue + blank = True + else: + blank = False sys.stdout.write(l) store.cleanup() -- 2.20.1