From 6d0ae6a9c27c0f33dc5833652fdffb300bea0fb9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 25 Jun 2019 14:10:41 +0200 Subject: bin/bisect-database-dumps: also bisect for "when did x vanish" --- bin/bisect-database-dumps | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin/bisect-database-dumps') diff --git a/bin/bisect-database-dumps b/bin/bisect-database-dumps index deb88f8..7ccbe16 100755 --- a/bin/bisect-database-dumps +++ b/bin/bisect-database-dumps @@ -13,7 +13,19 @@ has=$( ) if ! xzgrep -q "$@" "${has}"; then - >&2 printf 'cannot find "%s" in the latest dump\n' "$*" + >&2 printf 'cannot find "%s" in the latest dump - swapping directions\n' "$*" + dumps=$( + printf '%s\n' "${dumps}" | \ + tac + ) + has=$( + printf '%s\n' "$dumps" | \ + tail -n1 + ) + if ! xzgrep -q "$@" "${has}"; then + >&2 printf 'cannot find "%s" in the earliest dump either - swapping directions did not help\n' "$*" + exit 1 + fi fi has_not=$( @@ -23,6 +35,7 @@ has_not=$( if xzgrep -q "$@" "${has_not}"; then >&2 printf 'first dump does also have "%s"\n' "$*" + exit 1 fi count=$( -- cgit v1.2.3-70-g09d2