Thursday, August 12, 2021

teach portcheck about crates.inc

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.

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. 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.

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))
;;

No comments:

Post a Comment