Hi Philip,

On Thu, Sep 11, 2025 at 02:26:37PM -0700, Philip Guenther wrote:
> Hmm, if the regexp file names match a consistent, unambiguous pattern
> (like, all have the suffix “.ref”) then the command in the recipe could
> match that from the prerequisite list with $(filter %.ref, $^) so that the
> filename only appears as a literal in the prerequisite list.

Hmmm, currently I was using slightly different extensions:

        .grep   - for basic regexes.
        .egrep  - for regexes interpreted by grep -E.
        .pgrep  - for regexes interpreted by grep -P.

But yeah, that would be enough, since I can have a slightly different
filter for each recipe; that's okay.  Thanks!

I've applied this change (and the same thing in several other files,
just with slightly different file names and filters):

        diff --git a/share/mk/build/catman/troff.mk 
b/share/mk/build/catman/troff.mk
        index eda2a5faf..d17531990 100644
        --- a/share/mk/build/catman/troff.mk
        +++ b/share/mk/build/catman/troff.mk
        @@ -17,6 +17,7 @@ include $(MAKEFILEDIR)/configure/xfail.mk
         
         ext := .cat.set
         xfail := $(MAKEFILEDIR)/build/catman/troff.xfail
        +regexf := $(MAKEFILEDIR)/build/catman/troff.ignore.grep
         
         tgts := $(patsubst %, %$(ext), $(_NONSO))
         ifeq ($(SKIP_XFAIL),yes)
        @@ -24,16 +25,13 @@ tgts := $(filter-out $(patsubst %, 
$(_MANDIR)/%$(ext), $(file < $(xfail))), $(tg
         endif
         
         
        -troff_catman_ignore_grep := 
$(MAKEFILEDIR)/build/catman/troff.ignore.grep
        -
        -
         _CATMAN_set := $(tgts)
         
         
        -$(_CATMAN_set): %$(ext): %.cat.troff $(troff_catman_ignore_grep) $(MK) 
| $$(@D)/
        +$(_CATMAN_set): %$(ext): %.cat.troff $(regexf) $(MK) | $$(@D)/
                $(info  $(INFO_)TROFF           $@)
                ! ($(TROFF) -mandoc $(TROFFFLAGS_) $(NROFFFLAGS_) <$< 2>&1 >$@ \
        -          | $(GREP) -v -f '$(troff_catman_ignore_grep)' \
        +          | $(GREP) -v -f '$(filter %.grep, $^)' \
                   || $(TRUE); \
                ) \
                | $(GREP) ^ >&2
        @@ -45,6 +43,7 @@ build-catman-troff: $(_CATMAN_set);
         
         undefine ext
         undefine xfail
        +undefine regexf
         undefine tgts

And it works perfectly.  Thanks!  I've had to add a comment in the
commit message about why I need this, but that's fine.

> Philip Guenther


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Attachment: signature.asc
Description: PGP signature

Reply via email to