From crees@bayofrum.net  Mon Dec 24 22:39:18 2012
Return-Path: <crees@bayofrum.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D1650A21
	for <freebsd-gnats-submit@freebsd.org>; Mon, 24 Dec 2012 22:39:18 +0000 (UTC)
	(envelope-from crees@bayofrum.net)
Received: from mk-outboundfilter-1.mail.uk.tiscali.com (mk-outboundfilter-1.mail.uk.tiscali.com [212.74.114.37])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C1DF8FC0C
	for <freebsd-gnats-submit@freebsd.org>; Mon, 24 Dec 2012 22:39:17 +0000 (UTC)
Received: from 79-75-91-162.dynamic.dsl.as9105.com (HELO pegasus.bayofrum.net) ([79.75.91.162])
  by smtp.pipex.tiscali.co.uk with ESMTP; 24 Dec 2012 22:39:16 +0000
Received: by pegasus.bayofrum.net (Postfix, from userid 1001)
	id F19321B672; Mon, 24 Dec 2012 22:37:53 +0000 (GMT)
Message-Id: <20121224223753.F19321B672@pegasus.bayofrum.net>
Date: Mon, 24 Dec 2012 22:37:53 +0000 (GMT)
From: Chris Rees <crees@bayofrum.net>
Reply-To: Chris Rees <crees@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] ports-mgmt/portlint Check the Makefile header
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         174688
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portlint Check the Makefile header
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 24 22:40:02 UTC 2012
>Closed-Date:    Thu Dec 27 23:29:35 UTC 2012
>Last-Modified:  Thu Dec 27 23:29:35 UTC 2012
>Originator:     Chris Rees
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD pegasus.bayofrum.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sun Apr 29 12:29:02 BST 2012 root@pegasus.bayofrum.net:/usr/obj/usr/src/sys/PEGASUS amd64


	
>Description:
	This will make portlint accept only # Created by: followed by a space as an optional line, then # $FreeBSD$ in the Makefile, which should work as a check to avoid unneccessary churn when people correct mistakes.
>How-To-Repeat:
	
>Fix:

	It's not very elegant, but it works.

--- portlint-header.diff begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 309465)
+++ Makefile	(working copy)
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.13.13
+PORTVERSION=	2.13.14
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none
Index: src/portlint.pl
===================================================================
--- src/portlint.pl	(revision 309465)
+++ src/portlint.pl	(working copy)
@@ -1460,6 +1460,26 @@
 	}
 
 	#
+	# whole file: header
+	#
+	my @lines = split("\n", $whole);
+	print "OK: checking header in $file.\n" if ($verbose);
+	if ($lines[1] =~ /^# (?:New )?[Pp]orts collection [mM]akefile/) {
+		&perror("FATAL", $file, 1, "old style headers found.");
+	} elsif ($lines[1] =~ /^# Created by: \S/) {
+		if ($lines[2] !~ /^# \$$rcsidstr[:\$]/) {
+			&perror("FATAL", $file, 2, "header should be ".
+				"followed by \$$rcsidstr\$.");
+		} elsif ($lines[3] !~ /^$/) {
+			&perror("FATAL", $file, 3, "do not add extra ".
+				"empty comments after header.");
+		}
+	} elsif ($lines[1] !~ /^# \$$rcsidstr[:\$]/ or $lines[2] !~ /^$/) {
+		&perror("FATAL", $file, 1, "incorrect header; ".
+			"use Created by: with a space, then \$$rcsidstr\$.");
+	}
+
+	#
 	# whole file: $(VARIABLE)
 	#
 	if ($parenwarn) {
--- portlint-header.diff ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Dec 24 22:40:21 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174688 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Thu Dec 27 23:29:26 UTC 2012 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174688 
>Unformatted:
