[PATCH] lint-man.mk: Use a pipeline instead of the groff(1) wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This more explicitly shows how stuff really works, and allows
inspecting some intermediate steps in case it may be necessary.

Cc: Ralph Corderoy <ralph@xxxxxxxxxxxxxxx>
Cc: "G. Branden Robinson" <g.branden.robinson@xxxxxxxxx>
Cc: <groff@xxxxxxx>
Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>
---

Hi Ralph and Branden,

Would you recommend this change?  Is it correct?  It seems to work.

Cheers,

Alex


 lib/lint-man.mk | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/lib/lint-man.mk b/lib/lint-man.mk
index 63d86fe11..269240c3a 100644
--- a/lib/lint-man.mk
+++ b/lib/lint-man.mk
@@ -16,20 +16,29 @@ include $(srcdir)/lib/src.mk
 TMACDIR := $(SYSCONFDIR)/groff/tmac
 
 
+TBL := tbl
+
+DEFAULT_EQNFLAGS := -Tutf8
+EXTRA_EQNFLAGS   :=
+EQNFLAGS         := $(DEFAULT_EQNFLAGS) $(EXTRA_EQNFLAGS)
+EQN              := eqn
+
 TMACFILES            := $(shell $(FIND) $(TMACDIR) -not -type d | $(SORT))
 TMACNAMES            := $(basename $(notdir $(TMACFILES)))
-GROFF_CHECKSTYLE_LVL := 3
-DEFAULT_GROFFFLAGS   := -man
-DEFAULT_GROFFFLAGS   += -t
-DEFAULT_GROFFFLAGS   += -M $(TMACDIR)
-DEFAULT_GROFFFLAGS   += $(foreach x,$(TMACNAMES),-m $(x))
-DEFAULT_GROFFFLAGS   += -rCHECKSTYLE=$(GROFF_CHECKSTYLE_LVL)
-DEFAULT_GROFFFLAGS   += -ww
-DEFAULT_GROFFFLAGS   += -Tutf8
-DEFAULT_GROFFFLAGS   += -rLL=80n
-EXTRA_GROFFFLAGS     :=
-GROFFFLAGS           := $(DEFAULT_GROFFFLAGS) $(EXTRA_GROFFFLAGS)
-GROFF                := groff
+TROFF_CHECKSTYLE_LVL := 3
+DEFAULT_TROFFFLAGS   := -man
+DEFAULT_TROFFFLAGS   += -t
+DEFAULT_TROFFFLAGS   += -M $(TMACDIR)
+DEFAULT_TROFFFLAGS   += $(foreach x,$(TMACNAMES),-m $(x))
+DEFAULT_TROFFFLAGS   += -rCHECKSTYLE=$(TROFF_CHECKSTYLE_LVL)
+DEFAULT_TROFFFLAGS   += -ww
+DEFAULT_TROFFFLAGS   += -Tutf8
+DEFAULT_TROFFFLAGS   += -rLL=80n
+EXTRA_TROFFFLAGS     :=
+TROFFFLAGS           := $(DEFAULT_TROFFFLAGS) $(EXTRA_TROFFFLAGS)
+TROFF                := troff
+
+GROTTY := grotty
 
 DEFAULT_MANDOCFLAGS := -man
 DEFAULT_MANDOCFLAGS += -Tlint
@@ -48,7 +57,10 @@ lint_man    := $(foreach x,$(linters_man),lint-man-$(x))
 
 $(_LINT_man_groff): $(_LINTDIR)/%.lint-man.groff.touch: $(MANDIR)/% | $$(@D)/.
 	$(info LINT (groff)	$@)
-	$(GROFF) $(GROFFFLAGS) $< \
+	$(TBL) <$< \
+	| $(EQN) $(EQNFLAGS) \
+	| $(TROFF) $(TROFFFLAGS) \
+	| $(GROTTY) \
 	| sed 's/\x1b\[[^@-~]*[@-~]//g' \
 	| (! grep -n '.\{80\}.')
 	touch $@
-- 
2.37.2




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux