Hello,

since i missed a port whose COMMENT ended with a dot, i looked at
portcheck to warn for that case.  Turns out that for simple ports
without subpackages the current COMMENT check is wrong.

subpkg is "-" and so we ask make to dump "COMMENT-" instead of
COMMENT.

diff below fixes the dumping in the first hunk and adds a check for
trailing punctiation in the second hunk.  If ok will land in two
separate commits.

ok?

Index: portcheck
===================================================================
RCS file: /home/cvs/ports/infrastructure/bin/portcheck,v
retrieving revision 1.142
diff -u -p -r1.142 portcheck
--- portcheck   4 Mar 2022 20:27:05 -0000       1.142
+++ portcheck   23 Nov 2022 16:12:11 -0000
@@ -855,7 +855,7 @@ sub_checks() {
                        export SUBPACKAGE="$subpkg" FLAVOR="$flavor"
 
                        local wantlib_var=WANTLIB${subpkg%-}
-                       local vars="COMMENT$subpkg FULLPKGNAME$subpkg"
+                       local vars="COMMENT${subpkg%-} FULLPKGNAME${subpkg%-}"
                        vars="$vars MODULES"
                        vars="$vars PKG_ARCH$subpkg $wantlib_var WANTLIB-"
                        vars="$vars PERMIT_PACKAGE${subpkg%-}"
@@ -877,6 +877,12 @@ sub_checks() {
 
                                if [[ $comment == @(a|an|the)" "* ]]; then
                                        err "${portref}no leading articles in" \
+                                           "COMMENT${subpkg%-}, please"
+                               fi
+
+                               if [[ $comment == *[[:punct:]] ]]; then
+                                       err "${portref}no trailing" \
+                                           "punctuation in" \
                                            "COMMENT${subpkg%-}, please"
                                fi
 

Reply via email to