fix bin/tar-entry.sh and bin/tar-year.sh, improve bin/README.md, update Makefile

It turns out that `sed -i ''` is not portable. **sigh** Replaced use of
`sed -i ''` with other portable commands in `bin/tar-year.sh`.

Changed `bin/tar-entry.sh` VERSION from "1.3.4 2024-03-27"
to "1.3.5 2024-03-28".

Changed `bin/tar-year.sh` VERSION from "1.2 2024-03-27"
to "1.2.1 2024-03-28".

Changed `bin/gen-year-index.sh` VERSION from "1.0.4 2024-03-26"
to "1.0.5 2024-03-28".

Changed `bin/sort.gitignore.sh` VERSION from "1.1.3 2024-03-26"
to "1.1.4 2024-03-28".

Added new `bin/untar-year.sh` bin tool.

Tested `make untar_year_tarball` under Linux.

Added `make sort_gitignore` to sort entry `.gitignore` files.
The `make quick_www` and `make www` actions perform `make sort_gitignore`.

Added notes to `bin/README.md` (and thus to `bin/index.html` with
recommendations of top level Makefile actions that use selected bin
tools over all entries or years).

Tested `make www form_entry_tarball form_year_tarball untar_entry_tarball
untar_year_tarball` under Linux.

TODO: Retest `make www form_entry_tarball form_year_tarball
      untar_entry_tarball untar_year_tarball` under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-03-28 03:35:47 -07:00
1 parent f07fec3a98
commit e4a76879ba
7 files changed
+608 -63

No files matched your search

+14 -12
View File
@@ -83,7 +83,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
export VERSION="1.2 2024-03-27"
export VERSION="1.2.1 2024-03-28"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -645,26 +645,28 @@ if [[ -z $NOOP ]]; then
# use the entry's manifest to add files to the IOCCC year's manifest, excluding the entry's tarball file
#
awk -f "$FILELIST_ENTRY_JSON_AWK" "$ENTRY_JSON" >> "$TMP_MANIFEST_LIST"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: awk -f $FILELIST_ENTRY_JSON_AWK $ENTRY_JSON >> $TMP_MANIFEST_LIST failed, error: $status" 1>&2
exit 1
fi
# remove entry's tarball from the IOCCC year's manifest
# We do not include the entry's tarball from the IOCCC year's manifest
#
export ENTRY_ID="${YEAR_DIR}_${ENTRY_DIR}"
sed -i '' -e "/$ENTRY_ID\.tar\.bz2$/d" "$TMP_MANIFEST_LIST"
status="$?"
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: about to execute: awk -f $FILELIST_ENTRY_JSON_AWK $ENTRY_JSON |" \
"grep -v \"/$ENTRY_ID\.tar\.bz2$\" >> $TMP_MANIFEST_LIST" 1>&2
fi
awk -f "$FILELIST_ENTRY_JSON_AWK" "$ENTRY_JSON" | \
grep -v "/$ENTRY_ID\.tar\.bz2$" >> "$TMP_MANIFEST_LIST"
status="${PIPESTATUS[0]}"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: sed -i '' -e '/$ENTRY_ID.tar.bz2/d' $TMP_MANIFEST_LIST failed, error: $status" 1>&2
echo "$0: ERROR: awk -f $FILELIST_ENTRY_JSON_AWK $ENTRY_JSON |" \
"grep -v -F \"/$ENTRY_ID\.tar\.bz2$\" >> $TMP_MANIFEST_LIST failed, error: $status" 1>&2
exit 1
fi
done
# sort the manifest list
#
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: about to execute: LC_ALL=C sort -d $TMP_MANIFEST_LIST -o $TMP_MANIFEST_LIST" 1>&2
fi
LC_ALL=C sort -d "$TMP_MANIFEST_LIST" -o "$TMP_MANIFEST_LIST"
status="$?"
if [[ $status -ne 0 ]]; then