]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
share/mk/: build-ex-src: Support long $DISTNAME
authorAlejandro Colomar <alx@kernel.org>
Wed, 28 Feb 2024 12:49:55 +0000 (13:49 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 28 Feb 2024 15:03:58 +0000 (16:03 +0100)
When $DISTNAME is too long, mandoc(1) breaks the last line.  The last
two lines can always be removed safely, which makes it work also in this
case.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/build/examples/src.mk

index a8b5012bc99119f93952583f83e42f3c3d2d0b9d..f47a713e4b7cb8e61a20baa8b74f4d2e4354ce34 100644 (file)
@@ -7,6 +7,7 @@ MAKEFILE_BUILD_EX_SRC_INCLUDED := 1
 
 
 include $(MAKEFILEDIR)/build/_.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
 include $(MAKEFILEDIR)/configure/build-depends/findutils.mk
 include $(MAKEFILEDIR)/configure/build-depends/grep.mk
 include $(MAKEFILEDIR)/configure/build-depends/mandoc.mk
@@ -41,6 +42,7 @@ $(_UNITS_ex_src):
                -e '/^\.SH EXAMPLES/p' \
                -e "/^\... SRC BEGIN ($(@F))$$/,/^\... SRC END$$/p" \
        | $(MANDOC) -Tutf8 \
+       | $(HEAD) -n-2 \
        | $(SED) '/^[^ ]/d' \
        | $(SED) 's/^       //' \
        >$@