Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2011 13:24:10 -0700 (PDT)
From:      milki <milki@rescomp.berkeley.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        marcus@FreeBSD.org
Subject:   ports/159272: [PATCH] ports-mgmt/portlint should warn about missing / on WWW:
Message-ID:  <201107282024.p6SKOAb6073472@cibo.ircmylife.com>
Resent-Message-ID: <201107282030.p6SKUBo7063818@freefall.freebsd.org>

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

>Number:         159272
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portlint should warn about missing / on WWW:
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 28 20:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     milki
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
UC Berkeley - RSSP-IT
>Environment:
System: FreeBSD cibo.ircmylife.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011
>Description:

As described in the porter's handbook, the url line in pkg-descr should end with a /

Port maintainer (marcus@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:

Toggle the ending / on a WWW line in pkg-descr and run portlint -C
>Fix:

--- portlint-2.13.6.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/portlint/src/portlint.pl /usr/home/milki/ports/portlint/src/portlint.pl
--- /usr/ports/ports-mgmt/portlint/src/portlint.pl	2011-07-20 22:02:54.000000000 -0700
+++ /usr/home/milki/ports/portlint/src/portlint.pl	2011-07-28 13:19:43.000000000 -0700
@@ -662,10 +662,14 @@
 	if ($file =~ /\bpkg-descr/ && $tmp =~ m,http://,) {
 		my $has_url = 0;
 		my $has_www = 0;
+		my $has_endslash = 0;
 		foreach my $line (grep($_ =~ "http://", split(/\n+/, $tmp))) {
 			$has_url = 1;
 			if ($line =~ m,WWW:[ \t]+http://,) {
 				$has_www = 1;
+				if ($line =~ m,/$,) {
+					$has_endslash = 1;
+				}
 			}
 		}
 
@@ -673,6 +677,10 @@
 			&perror("WARN", $file, -1, "add \"WWW: UR:\" for this port if possible");
 		}
 
+		if (!$has_endslash) {
+			&perror("WARN", $file, -1, "end WWW URL with a \"/\"");
+		}
+
 		if ($has_url && ! $has_www) {
 			&perror("FATAL", $file, -1, "contains a URL but no \"WWW:\"");
 		}
--- portlint-2.13.6.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?201107282024.p6SKOAb6073472>