detect whitespace issues in rfc/index.txt earlier

by checking with each fetch and update.
This commit is contained in:
Mechiel Lukkien 2024-03-11 08:46:40 +01:00
parent 5f1157060e
commit b115c7b10d
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

View file

@ -8,7 +8,3 @@ link:
genxr:
go run xr.go -- xr/dev $$(git rev-parse --short HEAD) $$(git log -1 --date=format:"%Y-%m-%d" --format="%ad") $$(git tag --sort=v:refname | tail -n1) ../*.go ../*/*.go
check:
# output should be empty
-grep ' ' index.txt | grep -E -v '^[^ ]+ [^ ]+ [^ ]+ [^ ]+$$'

View file

@ -1,4 +1,13 @@
#!/bin/sh
#!/usr/bin/env bash
set -uo pipefail
if grep ' ' index.txt | grep -E -v '^[^ ]+ [^ ]+ [^ ]+ [^ ]+$$'; then
echo 'bad lines in rfc/index.txt'
exit 1
fi
set -e
for number in $(sed -n 's/^\([0-9][0-9]*\)[ \t].*$/\1/p' index.txt); do
if ! test -f "$number"; then
curl https://www.rfc-editor.org/rfc/rfc$number.txt >$number || rm $number