From 84a9fa5eb66b9ed838e5cf5c65a9592d64cb5815 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Thu, 20 Sep 2012 19:25:59 +0000 Subject: bsd.port.mk handles getting the primary category for us Since Created by: line appears to be popular, get Submitted by: from that Old-style Makefile headers should no longer be used --- Tools/scripts/addport | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Tools/scripts/addport') diff --git a/Tools/scripts/addport b/Tools/scripts/addport index 9cabca072693..7115344bc6cc 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -232,9 +232,7 @@ foreach my $thisdir (@dirs) { # Get the category name and make it suitable for use with svn my $category; - $_ = `$make -V CATEGORIES`; - m/([\w-]+)/; - $category = $1; + $category = `$make -V PKGCATEGORY`; chomp $category; if ($interactive) { if (prompt("Port $portname will be put in category $category. OK? " )) { @@ -271,7 +269,8 @@ foreach my $thisdir (@dirs) { open(MAKEFILE, "Makefile") or die("Can't open Makefile for reading: $!"); while() { chomp; - ($maintainer) = (m/^MAINTAINER=\s+(\w.*)$/) if (/^MAINTAINER=/); + die ("Old style Makefile headers detected") if (/^# (?:[Nn]ew )?[Pp]orts collection [Mm]akefile/); + ($maintainer) = (m/^# Created by:\s+(\w.*)$/) if (/^# Created by/); ($portversion) = (m/^PORTVERSION=\s+(\w.*)$/) if (/^PORTVERSION=/); } close(MAKEFILE); @@ -293,7 +292,7 @@ foreach my $thisdir (@dirs) { } print AUTOFILL $tmp; print AUTOFILL "PR: ports/$autofill\n" if ($autofill != -1); - print AUTOFILL "Submitted by: $maintainer" if ($autofill != -1); + print AUTOFILL "Submitted by: $maintainer" if ($maintainer && $autofill != -1); close(AUTOFILL); print "Okay, a commit log message was automatically generated for you.\n"; print "Now you will have a chance to edit it to make sure it's OK to use.\n"; -- cgit v1.2.3