@@ -575,6 +575,8 @@ distclean-local:
575575
576576# Hook the documentation building and validating recipes
577577# Note: these are optionally available (as determined during configure runs)
578+ # Only require SPELLCHECK_REPORT_MAYBE_UPDATED_DICT=yes for the last entry
579+ # (reduce noise for spellcheck-interactive)
578580# Maint: grep -l 'SPELLCHECK_' `git grep -lw spellcheck '*.am'`
579581spellcheck spellcheck-interactive :
580582 +@RES=0; \
@@ -596,7 +598,7 @@ spellcheck spellcheck-interactive:
596598 (cd $( builddir) /scripts/systemd && $( MAKE) $( AM_MAKEFLAGS) -s $@ ) || RES=$$? ; \
597599 (cd $( builddir) /scripts/udev && $( MAKE) $( AM_MAKEFLAGS) -s $@ ) || RES=$$? ; \
598600 (cd $( builddir) /scripts/upsdrvsvcctl && $( MAKE) $( AM_MAKEFLAGS) -s $@ ) || RES=$$? ; \
599- (cd $( builddir) /tests/NIT && $( MAKE) $( AM_MAKEFLAGS) -s $@ ) || RES=$$? ; \
601+ (cd $( builddir) /tests/NIT && $( MAKE) $( AM_MAKEFLAGS) SPELLCHECK_REPORT_MAYBE_UPDATED_DICT=yes -s $@ ) || RES=$$? ; \
600602 exit $$ RES
601603
602604# Note: the "all-docs" and "check-docs" targets may require tools not
@@ -626,12 +628,9 @@ INSTALL.nut UPGRADING NEWS README:
626628# definitions), to apply them into the committed document sources.
627629# Not bothering about with "make dist" constraints etc. - changes
628630# the contents of srcdir directly and intentionally.
629- # NOTE: There is a problem with `printf '%s' "${LINE}"` (double-quoted)
630- # that causes backslashes to be treated as escape characters, and
631- # shell replacements with `${VAR/pat/sub}` are not really portable.
632- # To address this, we use the pure POSIX shell `replace_all()`
633- # method suggested at https://stackoverflow.com/a/75037170/4715872
634- # WARNING: It may succumb to lines ending with asterisk however!
631+ # NOTE: Using `read -r` per POSIX standard to avoid backslashes
632+ # being treated as escape characters:
633+ # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html
635634MAINTAINER_ASCIIDOCS_RECIPE_DEBUG_STREAM = /dev/null
636635# MAINTAINER_ASCIIDOCS_RECIPE_DEBUG_STREAM = &2
637636
@@ -640,35 +639,19 @@ maintainer-asciidocs:
640639 USEDREV_NOSUBJ=" ` git log -1 --oneline --pretty=format:' %h (%cs)' docs/asciidoc-vars.conf` " || exit ; \
641640 echo " $@ : Updating asciidoc text sources with docs/asciidoc-vars.conf as of commit: $$ {USEDREV}" ; \
642641 echo " //GH_MARKUP_1095_INCLUDE_BEGIN//$$ {USEDREV}" > docs/asciidoc-vars.conf.lastrev.tmp || exit ; \
643- replace_all () { \
644- case " $$ 1" in * " $$ 2" * ) ;; * ) echo " $$ 1" ; return ;; esac ; \
645- RIGHT=" $$ 1" ; R=' ' ; \
646- while [ -n " $$ RIGHT" ]; do \
647- echo " LEFT='$$ LEFT' RIGHT='$$ RIGHT' => R='$$ R'" > $(MAINTAINER_ASCIIDOCS_RECIPE_DEBUG_STREAM ) ; \
648- LEFT=" $$ {RIGHT%%$$ 2*}" ; \
649- echo " => LEFT='$$ LEFT'" > $(MAINTAINER_ASCIIDOCS_RECIPE_DEBUG_STREAM ) ; \
650- if [ x" $$ LEFT" = x" $$ RIGHT" ]; then \
651- R=" $$ R$$ RIGHT" ; \
652- return ; \
653- fi ; \
654- R=" $$ R$$ LEFT$$ 3" ; \
655- RIGHT=" $$ {RIGHT#*$$ 2}" ; \
656- done ; \
657- echo " $$ R" ; \
658- } ; \
659642 find . -name ' *.adoc' -or -name ' *.txt' | ( \
660643 FILES=" " ; \
661644 while read F ; do \
662645 grep -E ' ^//+GH_MARKUP_1095_INCLUDE_(BEGIN|END)' " $$ F" > /dev/null \
663646 || { echo " $@ : SKIP: no GH_MARKUP_1095_INCLUDE_* tags: $$ F" ; continue ; } ; \
664647 rm -f " $$ {F}" * .tmp || exit ; \
665648 EXT=" 1.tmp" ; \
666- while IFS=' ' read LINE ; do \
649+ while IFS=' ' read -r LINE ; do \
667650 case " $$ {LINE}" in \
668651 " //GH_MARKUP_1095_INCLUDE_BEGIN" * ) EXT=" 2.tmp" ; continue ;; \
669652 " //GH_MARKUP_1095_INCLUDE_END" * | " ////GH_MARKUP_1095_INCLUDE_END" * ) EXT=" 3.tmp" ; continue ;; \
670653 esac ; \
671- printf ' %s\n' " ` replace_all " $$ {LINE}" ' \\ ' ' ' ' \\ ' ` " >> " $$ {F}.$$ {EXT}" || exit ; \
654+ printf ' %s\n' " $$ {LINE}" >> " $$ {F}.$$ {EXT}" || exit ; \
672655 done < " $$ F" || { echo " $@ : FAILED injection for $$ {F}" >&2 ; exit 1; } ; \
673656 if test -s " $$ {F}.2.tmp" && test -z " ` diff " $$ {F}.2.tmp" docs/asciidoc-vars.conf | tr -d ' \n' ` " ; then \
674657 rm -f " $$ {F}" * .tmp ; \
0 commit comments