On Thu, Aug 12, 2021 at 04:48:13PM +0200, Theo Buehler wrote:
> Now that a few Rust ports use crates.inc, I think we should teach
> portcheck about it. I didn't use @(|) for the pattern since the result
> seemed less readable.
> 
> Two things:
> 
> A few Rust ports use '.include <crates.inc>' I'll switch those to using
> '.include "crates.inc"' so the current directory is searched first.

I agree that "x" is better than <x>.

> For some reason, it was decided to do '.include "./modules.inc"' for Go
> ports. I doubt there is actually a benefit in adding ./ here, but I may
> be wrong. If there is none, I think we should leave it out since it's
> just noise.

Re-reading make(1) man page about .include :

    If double quotes are used, the including makefile's directory and
    any directories specified using the -I option are searched before
    the system makefile directory.

>From openbsd source trees (excepting modules.inc or crates.inc), "./x"
is never used. Only "${.CURDIR}/x" could be seen, but it should only
makes sense with obj/ usage (and so not with ports).

> Regardless of whether ./ is included or not, I think Go and
> Rust ports should use the same idiom. I kept the ./ in the check for
> now.

I agree with the fact to have the same idiom.

> Index: portcheck
> ===================================================================
> RCS file: /cvs/ports/infrastructure/bin/portcheck,v
> retrieving revision 1.138
> diff -u -p -r1.138 portcheck
> --- portcheck 2 Jun 2021 13:07:23 -0000       1.138
> +++ portcheck 12 Aug 2021 14:33:41 -0000
> @@ -612,9 +612,9 @@ check_port_dir() {
>                       portmk_exists=true
>                       ;;
>  
> -             modules.inc)
> +             crates.inc|modules.inc)
>                       test -f "$F" || err "$F is not a file"
> -                     fgrep -qx '.include "./modules.inc"' "$dir"/Makefile ||
> +                     fgrep -qx ".include \"./$F\"" "$dir"/Makefile ||
>                               err "$F not included in Makefile"
>                       ((++non_portmk))
>                       ;;
> 

-- 
Sebastien Marie

Reply via email to