fix bug in subst.entry-index.sh, improve awk scripts

Fixed a bug that was introduced into `bin/subst.entry-index.sh`
where the value `$HTML_SED` was set too early.  Shell functions
variables are evaluated when they are executed, not when they
are first parsed.  So exported variables used by a shell function
need to be set only before the shell function is executed.

Checkpoint `bin/cvt-submission.sh` as part of our testing.
Set file modes of 0444 for when `.auth.json` is formed from `.auth.json.xz`.

The awk scripts under bin put their name (basename) into error
messages to make it easier to debug any error they might raise.

Changed `bin/cvt-submission.sh` VERSION from "2.0.1 2025-05-01"
to "2.0.2 2025-05-17".

Changed `bin/filelist.entry.json.awk` VERSION from "1.0 2024-02-12"
to "1.0.1 2025-05-17".

Changed `bin/manifest.csv.entry.awk` VERSION from "1.0 2024-07-14"
to "1.0.1 2025-05-17".

Changed `bin/manifest.entry.json.awk` VERSION from "1.2.1 2024-11-16"
to "1.2.2 2025-05-17".

Changed `bin/subst.entry-index.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-05-17".

Changed `bin/subst.entry-navbar.awk` VERSION from "1.3 2024-08-02"
to "1.3.1 2025-05-17".

Changed `bin/subst.year-navbar.awk` VERSION from "1.2 2024-04-04"
to "1.2.1 2025-05-17".

Update sitemap.

Tested the above via `make update` on macOS.
This commit is contained in:
Landon Curt Noll committed 2025-05-17 23:56:22 -07:00
1 parent 665a46ef4a
commit 0aa790fd88
9 files changed
+136 -114

No files matched your search

+15 -14
View File
@@ -23,7 +23,8 @@ BEGIN {
# setup
#
VERSION="1.2.1 2024-11-16"
VERSION="1.2.2 2025-05-17"
NAME = "manifest.entry.json.awk"
found_manifest_array = 0; # 1 ==> we found the manifest ARRAY
within_manifest_array = 0; # 1 ==> found start of "manifest" : [ JSON array
begin_manifest_element = 0; # 1 ==> we have found the start of the manifest array element
@@ -334,7 +335,7 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF >= 3 && $1 ~ /^"
# validate exit code from jstrdecode
#
if (length(exit_code) == 0 || exit_code != 0) {
print "ERROR: unable to jstrdecode entry_text:", entry_text > "/dev/stderr";
print "ERROR:", NAME ": unable to jstrdecode entry_text:", entry_text > "/dev/stderr";
exit 213; # END section will output ERROR message about cannot JSON decode entry_text
}
@@ -354,42 +355,42 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF == 1 && $1 ~ /^}
# verify we have seen a file_path JSON member
#
if (length(file_path) == 0) {
print "ERROR: manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
exit 214;
}
# verify we have seen a inventory_order JSON member
#
if (length(inventory_order) == 0) {
print "ERROR: manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
exit 215;
}
# verify we have seen a OK_to_edit JSON member
#
if (length(OK_to_edit) == 0) {
print "ERROR: manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
exit 216;
}
# verify we have seen a display_as JSON member
#
if (length(display_as) == 0) {
print "ERROR: manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
exit 217;
}
# verify we have seen a display_via_github JSON member
#
if (length(display_via_github) == 0) {
print "ERROR: manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
exit 218;
}
# verify we have seen a entry_text JSON member
#
if (length(entry_text) == 0) {
print "ERROR: manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
exit 219;
}
@@ -432,40 +433,40 @@ END {
# case: we quit due to github unset
#
if (length(github) == 0) {
print "ERROR: github variable not set, call with -v github=REPO_URL" > "/dev/stderr";
print "ERROR:", NAME ": github variable not set, call with -v github=REPO_URL" > "/dev/stderr";
exit 220; # use 200 to match exit code from BEGIN
}
# case: we quit because we could not determine dir from ARGV[1]
#
if (length(dir) == 0) {
print "ERROR: cannot determine dir from:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": cannot determine dir from:", ARGV[1] > "/dev/stderr";
exit 221; # END section will output ERROR message about cannot find dir
}
if (length(YYYY) == 0) {
print "ERROR: cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
exit 222; # END section will output ERROR message about cannot find YYYY
}
# case: no manifest array was found
#
if (!found_manifest_array) {
print "ERROR: we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
exit 223;
}
# case: manifest array was found, but manifest array element did not finish
#
if (begin_manifest_element) {
print "ERROR: manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
exit 224;
}
# case: manifest array did not end
#
if (within_manifest_array) {
print "ERROR: manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
print "ERROR:", NAME ": manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
exit 225;
}
}