complete bin/cvt-submission.sh

Successfully tested `bin/cvt-submission.sh` on a new entry in a new
year that was generated from a submission entry.number directory via
`sbin/post-collect.sh` from the submit tools.

Changed `bin/cvt-submission.sh` prompts to use "[Y,n]" and to default to yes.

The `bin/cvt-submission.sh` processes and appends YYYY/dir to `.allyear`.

Improved 215 error message and exit code from `bin/subst.entry-navbar.awk`.

Changed `bin/cvt-submission.sh` VERSION from "2.0.3 2025-05-18"
to "2.0.4 2025-05-18".

Changed `bin/output-index-author.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-05-18".

Changed `bin/output-index-inventory.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-05-18".

Changed `bin/output-index-inventory.sh` VERSION from "2.0.1 2025-05-17"
to "2.0.2 2025-05-18".

Changed `bin/subst.entry-index.sh` VERSION from "2.0.1 2025-05-17"
to "2.0.2 2025-05-18".

Changed `bin/subst.entry-navbar.awk` VERSION from "1.3.1 2025-05-17"
to "1.3.2 2025-05-18".

Update sitemap.

Tested the above via `make update` on macOS.
This commit is contained in:
Landon Curt Noll committed 2025-05-18 02:28:16 -07:00
1 parent 0aa790fd88
commit f1f0993cf9
6 files changed
+169 -66

No files matched your search

+147 -48
View File
@@ -124,7 +124,7 @@ export LC_ALL="C"
# set variables referenced in the usage message # set variables referenced in the usage message
# #
export VERSION="2.0.2 2025-05-17" export VERSION="2.0.4 2025-05-18"
NAME=$(basename "$0") NAME=$(basename "$0")
export NAME export NAME
export V_FLAG=0 export V_FLAG=0
@@ -328,9 +328,9 @@ function prompt_string
echo echo
echo "Verify decoded $ITEM_NAME: $DECODED" 1>&2 echo "Verify decoded $ITEM_NAME: $DECODED" 1>&2
echo echo
echo -n 'Is that correct? [y,N]: ' echo -n 'Is that correct? [Y,n]: '
read -r Y_OR_N read -r Y_OR_N
if [[ $Y_OR_N == y || $Y_OR_N == Y || $Y_OR_N == yes || $Y_OR_N == YES || $Y_OR_N == Yes ]]; then if [[ -z $Y_OR_N || $Y_OR_N == y || $Y_OR_N == Y || $Y_OR_N == yes || $Y_OR_N == YES || $Y_OR_N == Yes ]]; then
break break
fi fi
echo echo
@@ -419,9 +419,9 @@ function prompt_integer
echo echo
echo "Verify decoded $ITEM_NAME: $DECODED" 1>&2 echo "Verify decoded $ITEM_NAME: $DECODED" 1>&2
echo echo
echo -n 'Is that correct? [y,N]: ' echo -n 'Is that correct? [Y,n]: '
read -r Y_OR_N read -r Y_OR_N
if [[ $Y_OR_N == y || $Y_OR_N == Y || $Y_OR_N == yes || $Y_OR_N == YES || $Y_OR_N == Yes ]]; then if [[ -z $Y_OR_N || $Y_OR_N == y || $Y_OR_N == Y || $Y_OR_N == yes || $Y_OR_N == YES || $Y_OR_N == Yes ]]; then
break break
fi fi
echo echo
@@ -901,6 +901,7 @@ if [[ ! -d $BIN_PATH ]]; then
fi fi
export BIN_DIR="bin" export BIN_DIR="bin"
# cd to topdir # cd to topdir
# #
if [[ ! -e $TOPDIR ]]; then if [[ ! -e $TOPDIR ]]; then
@@ -946,6 +947,27 @@ if [[ ! -s $TOP_FILE ]]; then
fi fi
# verify we have a non-empty readable .allyear file
#
export ALLYEAR=".allyear"
if [[ ! -e $ALLYEAR ]]; then
echo "$0: ERROR: .allyear does not exist: $ALLYEAR" 1>&2
exit 6
fi
if [[ ! -f $ALLYEAR ]]; then
echo "$0: ERROR: .allyear is not a regular file: $ALLYEAR" 1>&2
exit 6
fi
if [[ ! -r $ALLYEAR ]]; then
echo "$0: ERROR: .allyear is not a readable file: $ALLYEAR" 1>&2
exit 6
fi
if [[ ! -s $ALLYEAR ]]; then
echo "$0: ERROR: .allyear is not a non-empty writable file: $ALLYEAR" 1>&2
exit 6
fi
# verify that the bin/md2html.sh tool is executable # verify that the bin/md2html.sh tool is executable
# #
export MD2HTML_SH="$BIN_DIR/md2html.sh" export MD2HTML_SH="$BIN_DIR/md2html.sh"
@@ -1053,6 +1075,7 @@ export TAR_BZ2="$YYYY_DIR/$ENTRY_ID.tar.bz2"
export ENTRY_JSON="$YYYY_DIR/.entry.json" export ENTRY_JSON="$YYYY_DIR/.entry.json"
export DOT_GITIGNORE="$YYYY_DIR/.gitignore" export DOT_GITIGNORE="$YYYY_DIR/.gitignore"
export TRY_SH="$YYYY_DIR/try.sh" export TRY_SH="$YYYY_DIR/try.sh"
export TRY_ALT_SH="$YYYY_DIR/try.alt.sh"
export DOT_PATH="$YYYY_DIR/.path" export DOT_PATH="$YYYY_DIR/.path"
export README_MD="$YYYY_DIR/README.md" export README_MD="$YYYY_DIR/README.md"
export INDEX_HTML="$YYYY_DIR/index.html" export INDEX_HTML="$YYYY_DIR/index.html"
@@ -1120,6 +1143,7 @@ if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: REPO_NAME=$REPO_NAME" 1>&2 echo "$0: debug[3]: REPO_NAME=$REPO_NAME" 1>&2
echo "$0: debug[3]: CD_FAILED=$CD_FAILED" 1>&2 echo "$0: debug[3]: CD_FAILED=$CD_FAILED" 1>&2
echo "$0: debug[3]: TOP_FILE=$TOP_FILE" 1>&2 echo "$0: debug[3]: TOP_FILE=$TOP_FILE" 1>&2
echo "$0: debug[3]: ALLYEAR=$ALLYEAR" 1>&2
echo "$0: debug[3]: BIN_PATH=$BIN_PATH" 1>&2 echo "$0: debug[3]: BIN_PATH=$BIN_PATH" 1>&2
echo "$0: debug[3]: BIN_DIR=$BIN_DIR" 1>&2 echo "$0: debug[3]: BIN_DIR=$BIN_DIR" 1>&2
echo "$0: debug[3]: MD2HTML_SH=$MD2HTML_SH" 1>&2 echo "$0: debug[3]: MD2HTML_SH=$MD2HTML_SH" 1>&2
@@ -1137,6 +1161,8 @@ if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: TAR_BZ2=$TAR_BZ2" 1>&2 echo "$0: debug[3]: TAR_BZ2=$TAR_BZ2" 1>&2
echo "$0: debug[3]: ENTRY_JSON=$ENTRY_JSON" 1>&2 echo "$0: debug[3]: ENTRY_JSON=$ENTRY_JSON" 1>&2
echo "$0: debug[3]: DOT_GITIGNORE=$DOT_GITIGNORE" 1>&2 echo "$0: debug[3]: DOT_GITIGNORE=$DOT_GITIGNORE" 1>&2
echo "$0: debug[3]: TRY_SH=$TRY_SH" 1>&2
echo "$0: debug[3]: TRY_ALT_SH=$TRY_ALT_SH" 1>&2
echo "$0: debug[3]: DOT_PATH=$DOT_PATH" 1>&2 echo "$0: debug[3]: DOT_PATH=$DOT_PATH" 1>&2
echo "$0: debug[3]: README_MD=$README_MD" 1>&2 echo "$0: debug[3]: README_MD=$README_MD" 1>&2
echo "$0: debug[3]: INDEX_HTML=$INDEX_HTML" 1>&2 echo "$0: debug[3]: INDEX_HTML=$INDEX_HTML" 1>&2
@@ -1183,6 +1209,7 @@ if [[ ! -f $TEMPLATE_TRY_SH ]]; then
exit 6 exit 6
fi fi
# firewall - verify chkentry tool # firewall - verify chkentry tool
# #
if [[ ! -e $CHKENTRY_TOOL ]]; then if [[ ! -e $CHKENTRY_TOOL ]]; then
@@ -2045,6 +2072,43 @@ if [[ -z $NOOP ]]; then
exit 51 exit 51
fi fi
# if try.sh does not exist, copy example over, otherwise just update the manifest
#
if [[ ! -f $TRY_SH ]]; then
if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: about to run: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH" 1>&2
cp -f -p -v "$TEMPLATE_TRY_SH" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 52
fi
else
cp -f -p "$TEMPLATE_TRY_SH" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 53
fi
fi
fi
# write manifest csv line for try.sh
#
((++count))
manifest_csv try.sh 100 true shellscript true "script to try entry" \
>> "$TMP_MANIFEST_CSV"
# write manifest csv line for try.alt.sh if it exists
#
if [[ -f $TRY_ALT_SH ]]; then
((++count))
manifest_csv try.alt.sh 100 true shellscript true "script to try alternate code" \
>> "$TMP_MANIFEST_CSV"
fi
# perform some validation checks on the extra_file set # perform some validation checks on the extra_file set
# #
for EXTRA_FILE in $EXTRA_FILE_SET; do for EXTRA_FILE in $EXTRA_FILE_SET; do
@@ -2054,7 +2118,7 @@ if [[ -z $NOOP ]]; then
case "$EXTRA_FILE" in case "$EXTRA_FILE" in
prog.c|Makefile|prog.orig.c|index.html|README.md|remarks.md|\.*) prog.c|Makefile|prog.orig.c|index.html|README.md|remarks.md|\.*)
echo "$0: ERROR: invalid extra_file filename: $EXTRA_FILE" 1>&2 echo "$0: ERROR: invalid extra_file filename: $EXTRA_FILE" 1>&2
exit 52 exit 54
;; ;;
*) ;; *) ;;
esac esac
@@ -2063,11 +2127,11 @@ if [[ -z $NOOP ]]; then
# #
if [[ ! -e $YYYY_DIR/$EXTRA_FILE ]]; then if [[ ! -e $YYYY_DIR/$EXTRA_FILE ]]; then
echo "$0: ERROR: manifest file for extra_file does not exist: $YYYY_DIR/$EXTRA_FILE" 1>&2 echo "$0: ERROR: manifest file for extra_file does not exist: $YYYY_DIR/$EXTRA_FILE" 1>&2
exit 53 exit 55
fi fi
if [[ ! -f $YYYY_DIR/$EXTRA_FILE ]]; then if [[ ! -f $YYYY_DIR/$EXTRA_FILE ]]; then
echo "$0: ERROR: manifest file for extra_file is not a file: $YYYY_DIR/$EXTRA_FILE" 1>&2 echo "$0: ERROR: manifest file for extra_file is not a file: $YYYY_DIR/$EXTRA_FILE" 1>&2
exit 54 exit 56
fi fi
done done
@@ -2150,6 +2214,10 @@ if [[ -z $NOOP ]]; then
# process extra_files that are neither markdown nor HTML # process extra_files that are neither markdown nor HTML
# #
export BASENAME_TRY_SH
BASENAME_TRY_SH=$(basename "$TRY_SH")
export BASENAME_TRY_ALT_SH
BASENAME_TRY_ALT_SH=$(basename "$TRY_ALT_SH")
for EXTRA_FILE in $EXTRA_FILE_SET; do for EXTRA_FILE in $EXTRA_FILE_SET; do
# ignore HTML files because we processed them above # ignore HTML files because we processed them above
@@ -2158,6 +2226,24 @@ if [[ -z $NOOP ]]; then
continue continue
fi fi
# ignore prog.alt.c because we processed it above
#
if [[ $EXTRA_FILE == "$ALT_C" ]]; then
continue
fi
# ignore try.sh because we processed it above
#
if [[ $EXTRA_FILE == "$BASENAME_TRY_SH" ]]; then
continue
fi
# ignore try.alt.sh because we processed it above
#
if [[ $EXTRA_FILE == "$BASENAME_TRY_ALT_SH" ]]; then
continue
fi
# prompt for inventory_order # prompt for inventory_order
# #
VALUE= VALUE=
@@ -2220,7 +2306,7 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p -v $TEMPLATE_GITIGNORE $DOT_GITIGNORE failed," \ echo "$0: ERROR: cp -f -p -v $TEMPLATE_GITIGNORE $DOT_GITIGNORE failed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 55 exit 57
fi fi
else else
cp -f -p "$TEMPLATE_GITIGNORE" "$DOT_GITIGNORE" cp -f -p "$TEMPLATE_GITIGNORE" "$DOT_GITIGNORE"
@@ -2228,7 +2314,7 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p $TEMPLATE_GITIGNORE $DOT_GITIGNORE failed," \ echo "$0: ERROR: cp -f -p $TEMPLATE_GITIGNORE $DOT_GITIGNORE failed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 56 exit 58
fi fi
fi fi
fi fi
@@ -2239,37 +2325,6 @@ if [[ -z $NOOP ]]; then
manifest_csv .gitignore 4000000000 true gitignore true "list of files that should not be committed under git" \ manifest_csv .gitignore 4000000000 true gitignore true "list of files that should not be committed under git" \
>> "$TMP_MANIFEST_CSV" >> "$TMP_MANIFEST_CSV"
# if try.sh does not exist, copy example over, otherwise just update
# manifest
#
if [[ ! -f $TRY_SH ]]; then
if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: about to run: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH" 1>&2
cp -f -p -v "$TEMPLATE_TRY_SH" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 55
fi
else
cp -f -p "$TEMPLATE_TRY_SH" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 56
fi
fi
fi
# write manifest csv line for try.sh
#
((++count))
manifest_csv try.sh 100 true shellscript true "script to try entry" \
>> "$TMP_MANIFEST_CSV"
# form .path if needed # form .path if needed
# #
if [[ ! -f $DOT_PATH ]]; then if [[ ! -f $DOT_PATH ]]; then
@@ -2319,7 +2374,7 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: LC_ALL=C sort -t, -k2n -k1,1 -k3,6 $TMP_MANIFEST_CSV -o $TMP_MANIFEST_CSV failed," \ echo "$0: ERROR: LC_ALL=C sort -t, -k2n -k1,1 -k3,6 $TMP_MANIFEST_CSV -o $TMP_MANIFEST_CSV failed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 57 exit 59
elif [[ $V_FLAG -ge 3 ]]; then elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: sorted temporary manifest csv file: $TMP_MANIFEST_CSV" 1>&2 echo "$0: debug[3]: sorted temporary manifest csv file: $TMP_MANIFEST_CSV" 1>&2
fi fi
@@ -2362,7 +2417,7 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: $JPARSE_TOOL -q -- $TMP_ENTRY_JSON filed," \ echo "$0: ERROR: $JPARSE_TOOL -q -- $TMP_ENTRY_JSON filed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 58 exit 60
elif [[ $V_FLAG -ge 3 ]]; then elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: valid JSON: $TMP_ENTRY_JSON" 1>&2 echo "$0: debug[3]: valid JSON: $TMP_ENTRY_JSON" 1>&2
fi fi
@@ -2394,13 +2449,13 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: mv -f -- $TMP_ENTRY_JSON $ENTRY_JSON filed," \ echo "$0: ERROR: mv -f -- $TMP_ENTRY_JSON $ENTRY_JSON filed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 59 exit 61
elif [[ $V_FLAG -ge 1 ]]; then elif [[ $V_FLAG -ge 1 ]]; then
echo "$0: debug[1]: updated .entry.json: $ENTRY_JSON" 1>&2 echo "$0: debug[1]: updated .entry.json: $ENTRY_JSON" 1>&2
fi fi
if [[ ! -s $ENTRY_JSON ]]; then if [[ ! -s $ENTRY_JSON ]]; then
echo "$0: ERROR: not a non-empty .entry.json: $ENTRY_JSON" 1>&2 echo "$0: ERROR: not a non-empty .entry.json: $ENTRY_JSON" 1>&2
exit 60 exit 62
fi fi
fi fi
@@ -2434,7 +2489,7 @@ for EXTRA_FILE in $EXTRA_FILE_SET; do
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: $OTHERMD2HTML_SH -v $V_FLAG -- $YYYY_DIR/$EXTRA_FILE filed," \ echo "$0: ERROR: $OTHERMD2HTML_SH -v $V_FLAG -- $YYYY_DIR/$EXTRA_FILE filed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 61 exit 63
fi fi
elif [[ $V_FLAG -ge 3 ]]; then elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: -n disabled forming HTML: $YYYY_DIR/$HTML_FILE" 1>&2 echo "$0: debug[3]: -n disabled forming HTML: $YYYY_DIR/$HTML_FILE" 1>&2
@@ -2449,6 +2504,50 @@ for EXTRA_FILE in $EXTRA_FILE_SET; do
done done
# verify that YYYY_DIR is in .allyear
#
# We need to be sure that YYYY_DIR is in .allyear as tools such as bin/subst.entry-navbar.awk
# use the contents of that file to generate the navigation bar in the index.html web page.
#
grep -q "^$YYYY_DIR$" "$ALLYEAR" >/dev/null 2>&1
status="$?"
if [[ $status -ne 0 ]]; then
if [[ -z $NOOP ]]; then
# make .allyear writable
#
chmod +w "$ALLYEAR"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: chmod +w $ALLYEAR filed," \
"error code: $status" 1>&2
exit 64
fi
# append YYYY_DIR to .allyear
#
echo "$YYYY_DIR" >> "$ALLYEAR"
# sort .allyear
#
sort -f -d -u "$ALLYEAR" -o "$ALLYEAR"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: sort -f -d -u $ALLYEAR -o $ALLYEAR filed," \
"error code: $status" 1>&2
exit 65
fi
elif [[ $V_FLAG -ge 1 ]]; then
echo "$0: debug[3]: -n disabled adding YYYY_DIR: $YYYY_DIR to .allyear: $ALLYEAR" 1>&2
fi
elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: YYYY_DIR: $YYYY_DIR is already in .allyear: $ALLYEAR" 1>&2
fi
# form index.html if needed # form index.html if needed
# #
if [[ -z $NOOP ]]; then if [[ -z $NOOP ]]; then
@@ -2462,7 +2561,7 @@ if [[ -z $NOOP ]]; then
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: $MD2HTML_SH -v $V_FLAG -- $README_MD $INDEX_HTML filed," \ echo "$0: ERROR: $MD2HTML_SH -v $V_FLAG -- $README_MD $INDEX_HTML filed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 62 exit 66
fi fi
fi fi
@@ -2486,7 +2585,7 @@ if [[ $status -ne 0 ]]; then
echo "$0: ERROR: rm -f -v -- $INFO_JSON $AUTH_JSON $AUTH_JSON.xz $REMARKS_MD $YYYY_DIR/.prev" \ echo "$0: ERROR: rm -f -v -- $INFO_JSON $AUTH_JSON $AUTH_JSON.xz $REMARKS_MD $YYYY_DIR/.prev" \
"$YYYY_DIR/.submit.sh $YYYY_DIR/.txz $YYYY_DIR/.num.sh $YYYY_DIR/.orig filed," \ "$YYYY_DIR/.submit.sh $YYYY_DIR/.txz $YYYY_DIR/.num.sh $YYYY_DIR/.orig filed," \
"error code: $status" 1>&2 "error code: $status" 1>&2
exit 63 exit 65
fi fi
+3 -3
View File
@@ -122,7 +122,7 @@ export LC_ALL="C"
# set variables referenced in the usage message # set variables referenced in the usage message
# #
export VERSION="2.0.0 2025-03-13" export VERSION="2.0.1 2025-05-18"
NAME=$(basename "$0") NAME=$(basename "$0")
export NAME export NAME
export V_FLAG=0 export V_FLAG=0
@@ -640,8 +640,8 @@ if [[ ! -d $YEAR_DIR ]]; then
fi fi
export ENTRY_ID="${YEAR_DIR}_${ENTRY_DIR}" export ENTRY_ID="${YEAR_DIR}_${ENTRY_DIR}"
export DOT_YEAR="$YEAR_DIR/.year" export DOT_YEAR="$YEAR_DIR/.year"
if [[ ! -s $DOT_YEAR ]]; then if [[ ! -f $DOT_YEAR ]]; then
echo "$0: ERROR: not a non-empty file: $DOT_YEAR" 1>&2 echo "$0: ERROR: not a file: $DOT_YEAR" 1>&2
exit 6 exit 6
fi fi
# Now that we have moved to topdir, form and verify YYYY_DIR is a writable directory # Now that we have moved to topdir, form and verify YYYY_DIR is a writable directory
+3 -3
View File
@@ -134,7 +134,7 @@ export LC_ALL="C"
# set variables referenced in the usage message # set variables referenced in the usage message
# #
export VERSION="2.0.0 2025-03-13" export VERSION="2.0.1 2025-05-18"
NAME=$(basename "$0") NAME=$(basename "$0")
export NAME export NAME
export V_FLAG=0 export V_FLAG=0
@@ -417,8 +417,8 @@ if [[ ! -d $YEAR_DIR ]]; then
fi fi
export ENTRY_ID="${YEAR_DIR}_${ENTRY_DIR}" export ENTRY_ID="${YEAR_DIR}_${ENTRY_DIR}"
export DOT_YEAR="$YEAR_DIR/.year" export DOT_YEAR="$YEAR_DIR/.year"
if [[ ! -s $DOT_YEAR ]]; then if [[ ! -f $DOT_YEAR ]]; then
echo "$0: ERROR: not a non-empty file: $DOT_YEAR" 1>&2 echo "$0: ERROR: not a file: $DOT_YEAR" 1>&2
exit 6 exit 6
fi fi
# Now that we have moved to topdir, form and verify YYYY_DIR is a writable directory # Now that we have moved to topdir, form and verify YYYY_DIR is a writable directory
+2 -2
View File
@@ -136,7 +136,7 @@ export LC_ALL="C"
# set variables referenced in the usage message # set variables referenced in the usage message
# #
export VERSION="2.0.1 2025-05-17" export VERSION="2.0.2 2025-05-18"
NAME=$(basename "$0") NAME=$(basename "$0")
export NAME export NAME
export V_FLAG=0 export V_FLAG=0
@@ -735,7 +735,7 @@ echo "HEADER_3=$ABSTRACT"
awk -v entry_path="$YYYY_DIR" -f "$ENTRY_NAVBAR_AWK" "$DOT_ALLYEAR" awk -v entry_path="$YYYY_DIR" -f "$ENTRY_NAVBAR_AWK" "$DOT_ALLYEAR"
status="$?" status="$?"
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
echo "$0: ERROR: subst.entry-navbar.awk failed, error: $status" 1>&2 echo "$0: ERROR: awk -v entry_path=$YYYY_DIR -f $ENTRY_NAVBAR_AWK $DOT_ALLYEAR failed, error: $status" 1>&2
exit 1 exit 1
fi fi
+7 -3
View File
@@ -13,6 +13,10 @@
# #
# awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk YYYY/.year # awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk YYYY/.year
# #
# usage:
#
# awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk .allyear
#
# where: # where:
# #
# YYYY IOCCC year or mock # YYYY IOCCC year or mock
@@ -22,7 +26,7 @@ BEGIN {
# setup # setup
# #
VERSION="1.3.1 2025-05-17" VERSION="1.3.2 2025-05-18"
NAME = "subst.entry-navbar.awk" NAME = "subst.entry-navbar.awk"
process_next_line = 0; # 1 ==> we found our entry_path, now process the next line process_next_line = 0; # 1 ==> we found our entry_path, now process the next line
found_entry_path = 0; # 1 ==> we found our entry_path found_entry_path = 0; # 1 ==> we found our entry_path
@@ -179,10 +183,10 @@ END {
if (!found_entry_path) { if (!found_entry_path) {
# ERROR: entry_path was not found # ERROR: entry_path was not found
print "-e"; print "-e";
print "'" NAME ": did not find:", entry_path "'"; print "'" NAME ": did not find in:", ARGV[1], "entry_path:", entry_path "'";
print "-E"; print "-E";
print "215"; print "215";
exit exit 215;
} else if (process_next_line) { } else if (process_next_line) {
# no next line entry_path is the last line # no next line entry_path is the last line
+7 -7
View File
@@ -15226,7 +15226,7 @@
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/cvt-submission.sh</loc> <loc>https://www.ioccc.org/bin/cvt-submission.sh</loc>
<lastmod>2025-05-18T06:47:21+00:00</lastmod> <lastmod>2025-05-18T08:57:00+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/entry2csv.sh</loc> <loc>https://www.ioccc.org/bin/entry2csv.sh</loc>
@@ -15334,11 +15334,11 @@
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/output-index-author.sh</loc> <loc>https://www.ioccc.org/bin/output-index-author.sh</loc>
<lastmod>2025-04-16T20:59:19+00:00</lastmod> <lastmod>2025-05-18T08:48:13+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/output-index-inventory.sh</loc> <loc>https://www.ioccc.org/bin/output-index-inventory.sh</loc>
<lastmod>2025-04-16T20:59:19+00:00</lastmod> <lastmod>2025-05-18T08:48:44+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/output-year-index.sh</loc> <loc>https://www.ioccc.org/bin/output-year-index.sh</loc>
@@ -15382,11 +15382,11 @@
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/subst.entry-index.sh</loc> <loc>https://www.ioccc.org/bin/subst.entry-index.sh</loc>
<lastmod>2025-05-18T06:53:55+00:00</lastmod> <lastmod>2025-05-18T09:01:17+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/subst.entry-navbar.awk</loc> <loc>https://www.ioccc.org/bin/subst.entry-navbar.awk</loc>
<lastmod>2025-05-18T05:47:19+00:00</lastmod> <lastmod>2025-05-18T09:01:24+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/bin/subst.year-index.sh</loc> <loc>https://www.ioccc.org/bin/subst.year-index.sh</loc>
@@ -15486,7 +15486,7 @@
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/Makefile</loc> <loc>https://www.ioccc.org/Makefile</loc>
<lastmod>2025-05-18T06:31:07+00:00</lastmod> <lastmod>2025-05-18T08:54:49+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/markdown.html</loc> <loc>https://www.ioccc.org/markdown.html</loc>
@@ -15598,7 +15598,7 @@
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/status.html</loc> <loc>https://www.ioccc.org/status.html</loc>
<lastmod>2025-05-18T06:51:52+00:00</lastmod> <lastmod>2025-05-18T09:22:37+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://www.ioccc.org/status.json</loc> <loc>https://www.ioccc.org/status.json</loc>