ports/58292: [PATCH] port devel/portlint: first category in CATEGORIES must be base directory

Oliver Eikemeier eikemeier at fillmore-labs.com
Mon Oct 20 18:40:02 UTC 2003


>Number:         58292
>Category:       ports
>Synopsis:       [PATCH] port devel/portlint: first category in CATEGORIES must be base directory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 20 11:40:00 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.8-STABLE

>Description:

The usage of NOPORTSDOC seems to be a common error, see PR 53911 and PR 57749.

>How-To-Repeat:
>Fix:

- bsd.port.mk does:

  .for _CATEGORY in ${CATEGORIES}
  PKGCATEGORY?=	${_CATEGORY}
  .endfor
  _PORTDIRNAME!=	${BASENAME} ${.CURDIR}
  PORTDIRNAME?=	${_PORTDIRNAME}
  PKGORIGIN?=	${PKGCATEGORY}/${PORTDIRNAME}

  which is a little strange, but seems to assumes that the first
  category listed in CATEGORIES is the base directory of the ports
  directory. Instead of cleaning the whole mess up, require people
  to follow this convention. Non-conforming ports are listed in
  ports/58268.

- includes PR ports/57751

- the CATEGORIES <-> language handling in portlint need a rewrite.

--- portlint-CATEGORIES.patch begins here ---
--- devel/portlint/src/portlint.pl.orig	16 Aug 2003 20:42:44 -0000
+++ devel/portlint/src/portlint.pl	20 Oct 2003 18:23:25 -0000
@@ -543,6 +543,9 @@
 
 		if ($_ =~ /^(\%\%PORTDOCS\%\%)?share\/doc\//) {
 			&perror("WARN: $file $.: consider using DOCSDIR macro");
+			$sharedocused++;
+		} elsif ($_ =~ /^(\%\%PORTDOCS\%\%)?\%\%DOCSDIR\%\%/) {
+			$sharedocused++;
 		}
 
 		if ($_ =~ /^share\/examples\//) {
@@ -875,6 +878,9 @@
 		}
 	}
 	print "OK: checking for use of NOPORTDOCS.\n" if ($verbose);
+	if ($whole =~ /NOPORTSDOC/) {
+		&perror("WARN: NOPORTSDOC found. Do you mean NOPORTDOCS?");
+	}
 	if ($sharedocused && $whole !~ /defined\(NOPORTDOCS\)/
 	 && $whole !~ m#(\$[\{\(]PREFIX[\}\)]|$localbase)/share/doc#) {
 		&perror("WARN: use \".if !defined(NOPORTDOCS)\" to wrap ".
@@ -1117,6 +1123,12 @@
 	if (@cat == 0) {
 		&perror("FATAL: CATEGORIES left blank. set it to \"misc\"".
 		" if nothing seems apropriate.");
+	}
+
+	if ($committer && $makevar{'.CURDIR'} =~ m'/([^/]+)/[^/]+/?$') {
+		if ($cat[0] ne $1) {
+			&perror("FATAL: category \"$1\" must be listed first");
+		}
 	}
 
 #MICHAEL: can these three lang cat checks be combined?
--- portlint-CATEGORIES.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list