Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 2003 20:37:11 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Joe Marcus Clarke <marcus@FreeBSD.org>
Subject:   ports/58292: [PATCH] port devel/portlint: first category in CATEGORIES must be base directory
Message-ID:  <3F942B57.1050502@fillmore-labs.com>
Resent-Message-ID: <200310201840.h9KIe1W9006560@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F942B57.1050502>