Fix some robustness bugs in the scripts,
and reduce the number of external commands run so as to
speed up sweeping updates to multiple ports.
- BUGFIX: add IFS=$'\n' to hook scripts so they really parse the common git diff --name-only output line-wise irrespective of what's on the lines. (Adds robustness)
- BUGFIX: check_category_makefile breaks if a $category/Makefile contains a $portname subdir with "++", we put the portname into a grep -E pattern, which grep rejects with the error 'repetition-operator operand invalid'. Example ports that trigger this: audio/timidity++* and several devel/*, math/* and science port (47 in total).
FIX by adding a sed command to common.sh that adds a backslash before each special character of a grep -E modern regular expression, and using that.
- BUGFIX: replace echo by printf %s to print data we don't control. The echo man page tells us to use printf instead of echo if the string could contain dashes or backslash esacpes
- BUGFIX: check_mk_indentations only printed the last component of an impromperly indented file, which is unhelpful. Print the full repository path ($mkfile) instead.
- ROBUSTNESS: add a new check_aaa_filesnames script that rejects space, tab, quotes, backslashes, and anything that git's diff --name-only will escape (which includes the newline character).
- SPEEDUP check_category_makefile, check_created_by, check_files: replace the expensive "run awk process" to split items by shell built-ins such as case/in/esac, printf, read -r.
- FEATURE: pre-commit: support a PRE_COMMIT_KEEP_GOING env variable, similar to make -k, which will continue running further hook parts even after an error. This allows seeing all hook errors at once and fix them all at once, avoiding a fix-one-&-fail-again cycle.
PR: 296903
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296903