use bin/jval-wrapper.sh instead of direct grep of JSON files

We use the `bin/jval-wrapper.sh` tool to obtain information from JSON
files instead of attempting using a "GROSS HACK" that involved using
`grep(1)` (and friends) as those "GROSS HACK"s assumed that the layout of
the JSON was canonical.  The `bin/jval-wrapper.sh` tool is able to deal
with various layouts of JSON including non-canonical layouts.  Moreover,
by using the `bin/jval-wrapper.sh` tool we greatly reduce the places in
bin tools that contain "GROSS HACK"s.

Improve `-v 1` debug messages for `bin/gen-authors.sh` to give some
level of progress instead of a long pause.  Improve `-v 3` as well.

While the `bin/jval-wrapper.sh` tool is slower, it is also more accurate
in that various non-canonical JSON layouts will not confuse the tool.

Apologies for the slowdown.  Once the `jval(1)` tool is ready, it should
be faster than the `JSONPath.sh` tool that `bin/jval-wrapper.sh` uses now.

Added `-Q` to  `bin/jval-wrapper.sh` tool to perform a quick exit if
`authors.html` is newer than all `author/author_handle.json` files.

Updated the top level `Makefile` by adding `make quick_authors` rule
that will invoke `bin/gen-authors.sh -Q`.  Also changed `make quick_www`
to call `make quick_authors` instead of `make authors`.

Changed `bin/gen-authors.sh` VERSION from "1.10.7 2024-08-05"
to "1.11 2024-08-13".

Make a minor improvement in the usage message for `bin/gen-other-html.sh`.

Performed `make www` to test the above under macOS.

Performed `make quick_www` to test the above under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-08-13 16:51:34 -07:00
1 parent 21e29c9a68
commit 317a2a0c2c
3 files changed
+70 -110

No files matched your search

+13 -5
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env make
#build authors.html if out of date with author JSON files'!/usr/bin/env make
#
# IOCCC Makefile
@@ -300,9 +300,9 @@ indent.c:
# Finally: The rules in this section are NOT needed if you
# simple want to examine, run / test winning IOCCC entries.
.PHONY: help genpath genfilelist verify_entry_files gen_authors gen_location gen_years \
find_missing_links test entry_index gen_top_html thanks gen_other_html \
quick_other_html quick_entry_index \
.PHONY: help genpath genfilelist verify_entry_files gen_authors quick_authors \
gen_location gen_years find_missing_links test entry_index gen_top_html \
thanks gen_other_html quick_other_html quick_entry_index \
gen_year_index quick_www www untar_entry_tarball untar_year_tarball \
form_entry_tarball form_year_tarball tar gen_status gen_sitemap \
sitemap timestamp update csv2entry entry2csv
@@ -336,6 +336,7 @@ help:
@echo 'make genfilelist ;: generate YYYY level .filelist'
@echo 'make verify_entry_files ;: check to be sure all files in all entries exist'
@echo 'make gen_authors ;: generate the top level authors.html page'
@echo 'make quick_authors ;: build authors.html if out of date with author JSON files'
@echo 'make gen_location ;: generate the top level location.html page'
@echo 'make gen_years ;: generate the top level years.html page'
@echo 'make entry_index ;: force the build of ALL winner index.html files'
@@ -475,6 +476,13 @@ gen_authors: ${GEN_AUTHORS} authors.html
${GEN_AUTHORS} -v 1
@echo '=-=-=-=-= IOCCC complete make $@ =-=-=-=-='
# build authors.html if it is out of date from any author/author_handle.json file
#
quick_authors: ${GEN_AUTHORS} authors.html
@echo '=-=-=-=-= IOCCC begin make $@ =-=-=-=-='
${GEN_AUTHORS} -v 1 -Q
@echo '=-=-=-=-= IOCCC complete make $@ =-=-=-=-='
# generate the top level location.html page using the
# ${GEN_LOCATION} tool (bin/gen-location.sh).
#
@@ -668,7 +676,7 @@ quick_www:
@echo '=-=-=-=-= IOCCC complete make genpath =-=-=-=-='
${MAKE} genfilelist
${MAKE} verify_entry_files
${MAKE} gen_authors
${MAKE} quick_authors
${MAKE} gen_location
${MAKE} gen_years
${MAKE} gen_year_index