Make get-NWSdata report an error if dbfawks don't work

We are using get-NWSdata in CI testing now to make sure we catch when
our shapefiles for weather alerts don't have matching dbfawk files.

But the script exited cleanly whether we have 'em or not, even though it
reported when it found that some didn't work.

Make the script exit with error code one if any dbfawk doesn't match,
and report which ones don't so we know what has to be fixed.

This will make CI builds fail if any NWS changes break a dbfawk, and
call it to our attention when it happens.

Under normal circumstances, developers have to change get-NWSdata
manually every time NWS issues new shapefiles, and proper process
should be for us to *run* the thing ourselves after changing the
download links to make sure the dbfawks are right.  But if that were
to be forgotton, CI will now be there to tell us we've screwed up.
This commit is contained in:
Tom Russo 2026-01-11 08:54:03 -07:00
parent eb37e03966
commit ee337c0709

View file

@ -107,19 +107,30 @@ done
# tests fail.
####################
#
exitcode=0
for d in $FILE1 $FILE2 $FILE3 $FILE4 $FILE5 $FILE6 $FILE7; do
e=`echo $d | sed -e's/\(.*[0-9]\)[a-f]$/\1/'`
if [ -e $e.dbf ]; then
echo
echo $e.dbf
# Run in a separate shell so we don't mess up the current directory for the -e test above
(cd ${prefix}/share/xastir; ${prefix}/bin/testdbfawk -D config -d Counties/$e.dbf 2>&1 | head -3 | tail -1)
result=`cd ${prefix}/share/xastir; ${prefix}/bin/testdbfawk -D config -d Counties/$e.dbf 2>&1 | head -3 | tail -1`
echo $result
if [ "$result" = "No matching dbfawk signature found" ]; then
echo "Fix dbfawk for $e!"
exitcode=1
fi
fi
done
echo
if [ $exitcode -eq 1 ] ; then
echo "One or more dbfawk files is out of date. Fix the problem."
fi
exit $exitcode