[prev in list] [next in list] [prev in thread] [next in thread]
List: openbsd-ports
Subject: Re: portcheck: do not warn about extra file for modules.inc
From: Vadim Zhukov <persgray () gmail ! com>
Date: 2021-05-24 15:18:44
Message-ID: CAMy=nGFS8H0gRzr4Gt1K8ytte2KChjLeJ1PU+iuCyjqhnBLuOQ () mail ! gmail ! com
[Download RAW message or body]
пн, 24 мая 2021 г., 16:30 Paco Esteban <paco@e1e0.net>:
>
> Hi Vadim, thanks for the input.
> Comments below.
>
> On Mon, 24 May 2021, Vadim Zhukov wrote:
>
> > вс, 23 мая 2021 г. в 17:43, Paco Esteban <paco@e1e0.net>:
> > >
> > > Hi ports@,
> > >
> > > This makes portcheck(1) not complain about modules.inc being an extra
> > > file. This file is now being included on some Go ports, and I guess it
> > > can be used also on Rust ports.
> >
> >[ ... ]
>
> > Also, we could count the number of MODGO_MODULES and MODCARGO_CRATES a
> > bit later, during 'make show=...' analysis, and suggest creation of
> > modules.inc when those numbers get too high. But what threshold should
> > be? 10? 16? 42?
>
> I'm not sure this is useful. I would say we go the modules.inc route
> for every Go or Rust port. Even if they have a small number of modules
> or crates is quite convenient to be able to redirect the output of
> modcargo-gen-crates or modgo-gen-modules to override modules.inc without
> worrying about substitute the old instances of the variables when
> updating. But I would not make it mandatory.
Hm-m-m, maybe, if this pattern is going to be common, it'd be better
to add support for modules.inc to bsd.port.mk instead of plumbing
.include lines to Makefile here and there? Like, e.g., adding
'-include modules.inc', possibly with the similar guard variable,
nearby Makefile.inc handling code. espie@, what do you think?
> Anyway, here's the new version of the diff:
>
> diff efc26b0628a018a694a05768ccbc773a0ed2e5ad /usr/ports
> blob - bb8568b21b82fed260785c869a3cecfc4d4816cb
> file + infrastructure/bin/portcheck
> --- infrastructure/bin/portcheck
> +++ infrastructure/bin/portcheck
> @@ -612,6 +612,13 @@ check_port_dir() {
> portmk_exists=true
> ;;
>
> + modules.inc)
> + test -f "$F" || err "$F is not a file"
> + egrep -q '\.include "\./modules\.inc"' "$dir"/Makefile ||
> + err "$F not included in Makefile"
I'd recommend the following line instead:
fgrep -qx '.include "./modules.inc"'
This will catch more cases, including commented out lines, and reads
easier, IMO. :-) With it, fine by me.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic