diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2014-03-29 21:21:32 +0100 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2014-03-29 21:21:32 +0100 |
commit | e57f5c0980c98d011060a6372e376bc7b7bee608 (patch) | |
tree | cfa12a42df57372389cde11c70d191df3e44ab7e /check.sh | |
parent | a8ba56d69cdeaa0ca54c300f012324642178c8c2 (diff) | |
parent | 3092df2f6a7672354f933a4eb74499b79fdf4ef9 (diff) |
Merge branch 'ref-and-id'
Copied new entries from master blacklist.txt.
Conflicts:
blacklist.txt
Diffstat (limited to 'check.sh')
-rwxr-xr-x | check.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/check.sh b/check.sh new file mode 100755 index 0000000..fe96b1c --- /dev/null +++ b/check.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (C) 2014 Michał Masłowski <mtjm@mtjm.eu> +# +# 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|fsf|fedora)?:[^:]*:.*$' *.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 |