From 1c8cbe5ad4a1f8fa96a934e8672e5bffeef27f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Sat, 22 Mar 2014 13:38:06 +0100 Subject: Add a verification script. Fails, since we don't have references for most entries yet. --- check.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 check.sh (limited to 'check.sh') diff --git a/check.sh b/check.sh new file mode 100755 index 0000000..00d3b9a --- /dev/null +++ b/check.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (C) 2014 Michał Masłowski +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +# Verify the blacklist entries are correctly formatted. + +bad_entries="$(egrep -v '^[^:]*:[^:]*:(sv|debian|parabola)?:[^:]*:.*$' *.txt)" + +if [[ ! -z "$bad_entries" ]]; then + printf "Incorrectly formatted entries:\n\n%s\n" "$bad_entries" >&2 + exit 1 +fi + +unsourced="$(egrep '^[^:]*:[^:]*::[^:]*:.*$' *.txt)" + +if [[ ! -z "$unsourced" ]]; then + printf "[citation needed]:\n\n%s\n" "$unsourced" >&2 + exit 1 +fi -- cgit v1.2.2