19 Commits
Author SHA1 Message Date
Cody Boone Ferguson fc3574cac3 Typo fix in bin/jval-wrapper.sh 2025-11-18 04:37:31 -08:00
Landon Curt Noll 6da9a06be6 fix typo an jsp not found error message 2025-05-08 13:26:00 -07:00
Landon Curt Noll 3dcc1d44b9 update json wrapper tools
The json wrapper tools, `bin/jfmt-wrapper.sh`, `bin/jprint-wrapper.sh`
and `bin/jval-wrapper.sh` have been updated as follows:

The `-Q` option now does a quick test, ignores args, and exits.
With `-Q`, the required args are ignored and are not required.

The quick testing of `JSONPath.sh` via `-Q` is fixed.

Leading commends about the tools have improved.

A few typos have been fixed.

The `-v 3` variable printing is performed just before any `-N` test.

Changed `bin/jfmt-wrapper.sh` VERSION from "2.0.1 2025-04-21"
to "2.0.2 2025-05-04".

Changed `bin/jprint-wrapper.sh` VERSION from "2.0.1 2025-04-21"
to "2.0.2 2025-05-04".

Changed `bin/jval-wrapper.sh` VERSION from "2.0.1 2025-04-21"
to "2.0.2 2025-05-04".

Updated sitemap.

Tested the above via `make update` on macOS.
2025-05-04 18:56:58 -07:00
Landon Curt Noll 8ed2de8456 update bin tools to use JSONPath.sh Version 0.0.22
The `JSONPath.sh` has been updated (and bug fixed).
The `-A` option is gone and `-4` has been added.
See: https://github.com/lcn2/JSONPath.sh

Changed `bin/jfmt-wrapper.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-04-21".

Changed `bin/jprint-wrapper.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-04-21".

Changed `bin/jval-wrapper.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-04-21".

Tested the above via `make www gen_status gen_sitemap timestamp` on macOS.
2025-04-21 01:28:19 -07:00
Landon Curt Noll 49068e4c5b fix pipe failed error messages
We changed cases where the echo was `failed",` to `failed,"`.

This is a minor edit, no functionality was changed.
2025-03-28 20:24:51 -07:00
Landon Curt Noll d98a29a940 improve how the C locale is set
In conjunction with changes made to "the other repo",
we now set:

export LANG="C"
export LC_CTYPE="C"
export LC_NUMERIC="C"
export LC_TIME="C"
export LC_COLLATE="C"
export LC_MONETARY="C"
export LC_MESSAGES="C"
export LC_PAPER="C"
export LC_NAME="C"
export LC_ADDRESS="C"
export LC_TELEPHONE="C"
export LC_MEASUREMENT="C"
export LC_IDENTIFICATION="C"
export LC_ALL="C"

instead of just "$LC_ALL", "$LANG", "$LC_NUMERIC".
2025-03-14 17:59:04 -07:00
Landon Curt Noll bcdcbd58f9 set C locale
In all bin shell scripts, set `LC_ALL`, `LANG`, and `LC_NUMERIC` to "C".

Changed all bin shell script VERSION to "2.0.0 2025-03-13".

Tested the above via `make www` on macOS.  Only the sitemap was updated.
2025-03-13 18:56:27 -07:00
Landon Curt Noll 6b950a2e3c change references to post Great Fork Merge URLs
In preparation for the **Great Fork Merge**:

We change references for the repo from
`https://github.com/ioccc-src/temp-test-ioccc`
to `https://github.com/ioccc-src/winner`.

We change references for the web site from
`https://ioccc-src.github.io/temp-test-ioccc`
to `https://github.com/ioccc-src/winner`.

NOTE: There will be a **LOT OF LINKS BROKEN**, because of the changes
to the REPO URL and the WEBSITE URL, until the **Great Fork Merge**
updates the+[official IOCCC website](https://www.ioccc.org).
2024-12-28 21:56:40 -08:00
Landon Curt Noll 5c060586e6 use jstrdecode, removed unicode-fix.sed & unicode-chk.sh
Use ``jstrdecode(1)` to decode certain JSON strings,
such as "Full Name", "Abstract", "Award" and "Organization".

We now rely on a correctly decoding `jstrdecode(1)`.  The bin tools
now rely on `jstrdecode` with the following version or later:

>   jstrdecode version: 1.0.6 2024-10-08
>   JSON parser version: 1.1.7 2024-10-08

Removed `bin/unicode-fix.sed` and `bin/unicode-chk.sh`.
Removed `make unicode_chk`.

Fixed a few rule dependencies on `Makefile`.

Added information about `bin/jval-wrapper.sh` in `bin/README.md`.

Changed `bin/csv2entry.sh` VERSION from "1.4 2024-09-27"
to "1.5 2024-10-08".

Changed `bin/entry2csv.sh` VERSION from "1.4 2024-09-27"
to "1.5 2024-10-08".

Changed `bin/gen-authors.sh` VERSION from "1.13 2024-09-23"
to "1.14 2024-10-08".

Changed `bin/gen-location.sh` VERSION from "1.7 2024-09-23"
to "1.8 2024-10-08".

Changed `bin/gen-years.sh` VERSION from "1.5 2024-09-23"
to "1.6 2024-10-08".

Changed `bin/jfmt-wrapper.sh` VERSION from "1.2 2024-09-23"
to "1.3 2024-10-08".

Changed `bin/jprint-wrapper.sh` VERSION from "1.3 2024-09-23"
to "1.4 2024-10-08".

Changed `bin/jval-wrapper.sh` VERSION from "1.1 2024-09-23"
to "1.2 2024-10-08".

Changed `bin/output-index-author.sh` VERSION from "1.9 2024-09-23"
to "1.10 2024-10-08".

Changed `bin/output-year-index.sh` VERSION from "1.5 2024-09-23"
to "1.6 2024-10-08".

Changed `bin/subst.entry-index.sh` VERSION from "1.7 2024-09-27"
to "1.8 2024-10-08".

Perform `make www` to perform the above and test under macOS.
2024-10-08 23:12:04 -07:00
Landon Curt Noll 499be5983d use jsp tool, workaround JSON Unicode bugs, misc fixes
If the [jsp tool](https://github.com/kjozsa/jsp) is
installed, it will be used in favor of the [JSONPath.sh
tool](https://github.com/lcn2/JSONPath.sh).

Updated `bin/jfmt-wrapper.sh`, `bin/jprint-wrapper.sh`, and
`bin/jval-wrapper.sh` to use jsp if found.  These 3 tools may be given
`-t tool` where tool is either "_jsp_" or "_JSONPath.sh_" for force the
use of the tool.  They also use `-Q` to perform a quick check tool using
trivial input.

The `bin/jval-wrapper.sh` tool had been simplified.  The `-w`,
`-i` and `-u` options are gone.  Instead it has:

```
    -b    print only values (def: print both JSON member and JSON value)
    -q    remove enclosing double quotes (def: keep any enclosing double quotes)
```

Add `make all_jfmt` to Makefile to canonically format all entry and
author handle JSON files.

A sed script `bin/unicode-fix.sed` has been added that converts
JSON string "_\u[0-9A-Fa-f]{4}_" encoding that may arise from known
JSON data.  This is done as a work-a-round for [Unicode / UTF-8
issues](https://github.com/xexyl/jparse/issues/13) with `jstrdecode(1)`.

The `bin/unicode-chk.sh` tool, if given on file arguments, scans
all `.entry.json` and `author/author_handle.json` JSON files to be
sure that, after `bin/unicode-fix.sed` processing, no JSON string
"_\u[0-9A-Fa-f]{4}_" encodings remain.

Removed all `-j jparse` args from commands.  Instead the `jparse(1)`
tool is looked for along $PATH.

Added `combine_author_handle.sh` tool to transform all of the
`author/author_handle.json` files into a temporary as a single JSON
file so that `bin/jval-wrapper.sh` tool may be used to extract all
"_sort_word_" or all "_entry_id_" values.

Changed `bin/all-jfmt.sh` VERSION from "1.0 2024-08-31"
to "1.1 2024-09-24".

Changed `bin/csv2entry.sh` VERSION from "1.2.3 2024-08-30"
to "1.3 2024-09-23".

Changed `bin/cvt-submission.sh` VERSION from "1.1 2024-08-31"
to "1.2 2024-09-23".

Changed `bin/entry2csv.sh` VERSION from "1.2.1 2024-08-17"
to "1.3 2024-09-23".

Changed `bin/gen-authors.sh` VERSION from "1.12 2024-08-18"
to "1.13 2024-09-23".

Changed `bin/gen-location.sh` VERSION from "1.6 2024-08-18"
to "1.7 2024-09-23".

Changed `bin/gen-status.sh` VERSION from "1.6 2024-08-17"
to "1.7 2024-09-23".

Changed `bin/gen-years.sh` VERSION from "1.4 2024-08-17"
to "1.5 2024-09-23".

Changed `bin/jfmt-wrapper.sh` VERSION from "1.1 2024-08-20"
to "1.2 2024-09-23".

Changed `bin/jprint-wrapper.sh` VERSION from "1.1 2024-08-20"
to "1.3 2024-09-23".

Changed `bin/jval-wrapper.sh` VERSION from "1.0.4 2024-08-20"
to "1.1 2024-09-23".

Changed `bin/manifest.entry.json.awk` VERSION from "1.1.2 2024-07-28"
to "1.2 2024-09-17".

Changed `bin/output-index-author.sh` VERSION from "1.8 2024-08-17"
to "1.9 2024-09-23".

Changed `bin/output-year-index.sh` VERSION from "1.4.4 2024-08-05"
to "1.5 2024-09-23".

Changed `bin/subst.entry-index.sh` VERSION from "1.5 2024-08-13"
to "1.6 2024-09-23".

Added `bin/combine_author_handle.sh` VERSION "1.0 2024-09-23".

Added `bin/unicode-chk.sh` VERSION "1.0 2024-09-23".

Added `bin/unicode-fix.sed` VERSION "1.0 2024-09-23".

Perform `make www` to perform the above and test under macOS.

FYI: On our MacBook Pro, `make www` took:

```
    make www  631.79s user 264.95s system 94% cpu 15:53.71 total
```

FYI: On our MacBook Pro, `make quick_www` took:

```
    make quick_www  81.43s user 58.26s system 102% cpu 2:16.02 total
```
2024-09-24 04:04:27 -07:00
Landon Curt Noll afe9f9ea08 change JSON wrapper tools to not use -T with JSONPATH.sh
In keeping with [GH-issues 931](https://github.com/ioccc-src/mkiocccentry/issues/931),
we remove the use of `-T` from the `JSONPATH.sh` tool.  This will implement JSON
formatting using multiples of 4 ASCII spaces and without TABs.

Changed `bin/jfmt-wrapper.sh` VERSION form "1.0.2 2024-08-08"
to "1.1 2024-08-20".

Changed `bin/jprint-wrapper.sh` VERSION form "1.0.2 2024-08-08"
to "1.1 2024-08-20".

Changed `bin/jval-wrapper.sh` VERSION form "1.0.3 2024-08-11"
to "1.0.4 2024-08-20".
2024-08-20 11:25:00 -07:00
Cody Boone Ferguson 03423b67ad Typo fix in bin/j{fmt,print,val}-wrapper.sh 2024-08-19 09:08:11 -07:00
Landon Curt Noll 0e5864b8b0 use yet even more 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.

Adjusted `bin/gen-status.sh` to use `bin/jval-wrapper.sh`.

Changed `bin/gen-status.sh` VERSION from "1.5.8 2024-08-05"
to "1.6 2024-08-17".

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

Adjusted `bin/gen-years.sh` to use `bin/jval-wrapper.sh`.

Changed `bin/gen-years.sh` VERSION from "1.3.7 2024-08-05"
to "1.4 2024-08-17".

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

Adjusted `bin/output-index-author.sh` to use `bin/jval-wrapper.sh`.

Changed `bin/output-index-author.sh` VERSION from "1.7.3 2024-08-05"
to "1.8 2024-08-17".

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

Added `make quick_year_index` to generate year level index.html files
when year level `YYYY/README.md` is newer.

The `make quick_www` calls `quick_year_index` instead of `make gen_year_index`.

The `bin` directory is now sat as `BIN_PATH=$TOPDIR/bin`, where
`$TOPDIR` is determined by top of the git repo (as determined by
the command: `git rev-parse --is-inside-work-tree`) and potentially
modified by `-d topdir`.  After `cd $TOPDIR`, we set `BIN_DIR=bin`.

All tools from this repo are now assumed to under "$BIN_DIR".  Removed
command like options such as `-T md2html.sh`, and `-p tool` that used
to be able to change the location of a `bin` tool.

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

Changed `bin/gen-location.sh` VERSION from "1.5 2024-08-17"
to "1.6 2024-08-18".

Changed `bin/readme2index.sh` VERSION from "1.2.7 2024-08-05"
to "1.3 2024-08-17".

Modified `bin/all-run.sh` to use the `bin` directory mechanism.
Modified `bin/all-years.sh` to use the `bin` directory mechanism.
Modified `bin/gen-other-html.sh` to use the `bin` directory mechanism.
Modified `bin/gen-year-index.sh` to use the `bin` directory mechanism.
Modified `bin/md2html.sh` to use the `bin` directory mechanism.
Modified `bin/quick-readme2index.sh` to use the `bin` directory mechanism.
Modified `bin/readme2index.sh` to use the `bin` directory mechanism.

Changed `bin/all-run.sh` VERSION from "1.3.6 2024-08-05"
to "1.4 2024-08-17".

Changed `bin/all-years.sh` VERSION from "1.0.5 2024-08-05"
to "1.1 2024-08-17".

Changed `bin/gen-other-html.sh` VERSION from "1.3 2024-08-11"
to "1.4 2024-08-17".

Changed `bin/gen-year-index.sh` VERSION from "1.1.2 2024-08-05"
to "1.2 2024-08-17".

Changed `bin/quick-readme2index.sh` VERSION from "1.1.7 2024-08-05"
to "1.2 2024-08-17".

Changed `bin/md2html.sh` VERSION from "1.5.5 2024-08-05"
to "1.6 2024-08-17".

Added some whitespace in the form of empty lines to tools.

Made checks for tools under `bin` directory more consistent.

When using `-Q` (quick mode) and the prerequisite files are newer,
we force the target to be touched so that a later run will not
have to build the target HTML file.

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

Performed `make www` to test the above under macOS.
2024-08-18 02:10:25 -07:00
Landon Curt Noll ee3b035080 Merge pull request #2628 from xexyl/typo-bin-j-tools
Typo fixes in {jfmt,jval}-wrapper.sh scripts
2024-08-14 11:24:37 -07:00
Cody Boone Ferguson 7e57651e37 Typo fixes in {jfmt,jval}-wrapper.sh scripts
The wrong tools were referred to, likely a yank paste error from
jprint-wrapper.sh (as all three referred to jprint).

These three tools (and jnamval) will be developed (by me and perhaps
partly by Landon) later on, after IOCCC28 (because much more discussion
is needed before they can be developed and because we are trying to get
the next IOCCC running as quickly as possible) so as the comments state,
a different tool is used at this time. The comments, however, note that
it is a hack until the specific tools have been developed and even if it
does not matter that much the right tools should be mentioned.
2024-08-14 09:37:55 -07:00
Landon Curt Noll 21e29c9a68 checkpoint on bin/cvt-submission.sh
This is a checkpoint on `bin/cvt-submission.sh` development.

The `bin/cvt-submission.sh` tool now forms a compressed tarball
to contain submission files that will be modified or removed
by the tool.  The compressed tarball formed will be of the form
`/var/tmp/YYYY_dir.save.YYYYMMDD.hhmmss.tar.bz2`.

Added `-u` facility to  `bin/jval-wrapper.sh` to strip unnecessary
leading path elements.

Changed `bin/jval-wrapper.sh` VERSION from "1.0.2 2024-08-08"
to "1.0.3 2024-08-11".

Changed `bin/cvt-submission.sh` VERSION from "1.0.3 2024-08-09"
to "1.0.4 2024-08-11".

Performed `make quick_www` to test the above under macOS.
2024-08-13 14:42:06 -07:00
Landon Curt Noll 3fcae6f0c9 remove cd to topdir from JSON wrapper tols
The JSON related wrapper tools do not need to cd to topdir, so we
removed ahe code that finds and cd's to the top directory of the repo.
The tools that will call JSON related wrapper tools will have already
have moved to the top directory (topdir) of the repo.

Changed `bin/jfmt-wrapper.sh` VERSION from "1.0.1 2024-08-05"
to "1.0.2 2024-08-08".

Changed `bin/jprint-wrapper.sh` VERSION from "1.0.1 2024-08-05"
to "1.0.2 2024-08-08".

Changed `bin/jval-wrapper.sh` VERSION from "1.0.1 2024-08-05"
to "1.0.2 2024-08-08".

Performed `make quick_www` to accomplish the above and to test under macOS.
2024-08-08 18:22:26 -07:00
Landon Curt Noll 31d4f9d302 change bin/jval-wrapper.sh to have default pattern
With only 1 arg, `bin/jval-wrapper.sh` will print all JSON values found.

Changed `bin/jval-wrapper.sh` VERSION from "1.0 2024-08-05"
to "1.0.1 2024-08-05".
2024-08-05 01:53:14 -07:00
Landon Curt Noll 1732c368ed add bin/jval-wrapper.sh tool
We form a wrapper for the `jval(1)`, a tool that allow the printing of JSON values.

We propose that the grammar used by JSONPath.sh(1):

>   https://github.com/lcn2/JSONPath.sh

becomes the model for how `jval(1)` prints JSON values.  Consider, for, example:

>   JSONPath.sh -w -f 1984/mullender/.entry.json '$author_set..author_handle'

and in particular:

>   JSONPath.sh -w -b -f 1984/mullender/.entry.json '$author_set..author_handle'

as a model of printing the `author_handle` values from the JSON `author_set` array.

See the following URL for more information.

>   https://github.com/lcn2/JSONPath.sh?tab=readme-ov-file#jsonpath-patterns-and-extensions
2024-08-05 00:13:53 -07:00