From: Alejandro Colomar Date: Sun, 24 Aug 2025 15:51:45 +0000 (+0200) Subject: share/mk/: lint-man-poems: Align output X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbc3270a88165851aa5e7ab5d1f99dc1acb9624d;p=thirdparty%2Fman-pages.git share/mk/: lint-man-poems: Align output pcre2grep(1) doesn't have a -T flag, so we need to script a bit to do something similar. Signed-off-by: Alejandro Colomar --- diff --git a/share/mk/lint/man/poems.mk b/share/mk/lint/man/poems.mk index 239a973e0..38492b1d3 100644 --- a/share/mk/lint/man/poems.mk +++ b/share/mk/lint/man/poems.mk @@ -7,10 +7,12 @@ MAKEFILE_LINT_MAN_POEMS_INCLUDED := 1 include $(MAKEFILEDIR)/build/man/nonso.mk +include $(MAKEFILEDIR)/configure/build-depends/awk/awk.mk include $(MAKEFILEDIR)/configure/build-depends/coreutils/cat.mk include $(MAKEFILEDIR)/configure/build-depends/coreutils/echo.mk include $(MAKEFILEDIR)/configure/build-depends/coreutils/touch.mk include $(MAKEFILEDIR)/configure/build-depends/pcre2-utils/pcre2grep.mk +include $(MAKEFILEDIR)/configure/build-depends/sed/sed.mk ext := .lint-man.poems.touch @@ -28,7 +30,12 @@ $(tgts): %$(ext): % $(regexf) $(MK) | $$(@D)/ $(CAT) <$< \ | if $(PCRE2GREP) -f '$(filter %.pcre2grep, $^)' >/dev/null; then \ >&2 $(ECHO) "lint-man-poems: $<: Use semantic newlines (see man-pages(7)):"; \ - >&2 $(PCRE2GREP) -n -f '$(filter %.pcre2grep, $^)' <$<; \ + $(PCRE2GREP) -n -f '$(filter %.pcre2grep, $^)' <$< \ + | $(SED) -E 's/([^:]+:)(.*)/\1\n\t\2/' \ + | $(AWK) -F: \ + '/^[^\t]/{ printf("%7d:", $$1); }; \ + /^\t/{ print($$0); };' \ + >&2; \ exit 1; \ fi; $(TOUCH) $@