From b372ff1f5916fdbf29dddea085c296a766aaa4d4 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Wed, 9 Nov 2022 13:18:56 -0800 Subject: [PATCH] add script that I used to fix up some bugs.. --- fixbci.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 fixbci.sh diff --git a/fixbci.sh b/fixbci.sh new file mode 100644 index 0000000..6fdee0e --- /dev/null +++ b/fixbci.sh @@ -0,0 +1,30 @@ +# This script can be used to fix up errors in the main database. +# +# This fixes up an error where the CI URL prefex wasn't properly +# added. + +( + awk '{ print $9 }' snapshot.complete.idx | grep -v ^https; + echo 2; + cat snapshot.complete.idx) | + awk ' +BEGIN { + state = 0 +} + +state == 0 && $0 == "2" { + state = 1 + next +} + +state == 0 { + fix[$1] = 1 +} + +state == 1 { + if ($9 in fix) + $9 = "https://download.freebsd.org/ftp/snapshots/CI-IMAGES/" $9 + + print +} +'