пн, 24 мая 2021 г., 16:30 Paco Esteban <p...@e1e0.net>: > > Hi Vadim, thanks for the input. > Comments below. > > On Mon, 24 May 2021, Vadim Zhukov wrote: > > > вс, 23 мая 2021 г. в 17:43, Paco Esteban <p...@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.