On 09 Nov 2022 16:18, Alejandro Colomar wrote: > --- a/lib/lint-man.mk > +++ b/lib/lint-man.mk i guess not a new issue, but it feels like writing lint logic in Makefiles is not the best use of time. this logic is really hairy. > +$(_LINT_man_tbl): $(_LINTDIR)/%.lint-man.tbl.touch: $(MANDIR)/% | $$(@D)/. > + $(info LINT (tbl) $@) > + if $(GREP) '^\.TS$$' <$< >/dev/null && ! $(HEAD) -n1 <$< | $(GREP) '\\" t$$' >/dev/null; then \ POSIX grep has a -q option so you don't have to redirect to /dev/null. if $(GREP) -q '^\.TS$$' <$< && ... also, is there a reason you're using a redirect instead of just passing the file to grep ? the redirect works, but it seems to contribute to general "this code is hard for humans to read". i don't think you really need to be concerned with files starting with dashes ... if $(GREP) -q '^\.TS$$' $< && ... or more completely: if $(GREP) -q '^\.TS$$' $< && ! $(HEAD) -n1 $< | $(GREP) -q '\\" t$$'; then > + fi; don't need this trailing semi-colon -mike
Attachment:
signature.asc
Description: PGP signature