svn commit: r421545 - head/Tools/scripts
Mathieu Arnold
mat at FreeBSD.org
Thu Sep 8 12:49:04 UTC 2016
Author: mat
Date: Thu Sep 8 12:49:02 2016
New Revision: 421545
URL: https://svnweb.freebsd.org/changeset/ports/421545
Log:
Use make(1) to extract variables from a Makefile, not grep.
PR: 212486
Submitted by: mat
Approved by: crees (maintainer)
Sponsored by: Absolight
Modified:
head/Tools/scripts/addport
Modified: head/Tools/scripts/addport
==============================================================================
--- head/Tools/scripts/addport Thu Sep 8 12:41:02 2016 (r421544)
+++ head/Tools/scripts/addport Thu Sep 8 12:49:02 2016 (r421545)
@@ -276,14 +276,14 @@ foreach my $thisdir (@dirs) {
$pkgcomment = `cat pkg-descr`;
$pkgcomment .= "\n" if ($autofill != -1);
}
+ chomp($maintaineraddr = `$make $passenv -V MAINTAINER`);
+ chomp($portversion = `$make $passenv -V PORTVERSION`);
# Read Makefile to find necessary variables.
open(MAKEFILE, "Makefile") or die("Can't open Makefile for reading: $!");
while(<MAKEFILE>) {
chomp;
die ("Old style Makefile headers detected") if (/^# (?:[Nn]ew )?[Pp]orts collection [Mm]akefile/);
($maintainer) = (m/^# Created by:\s+(\w.*)$/) if (/^# Created by/);
- ($maintaineraddr) = (m/^MAINTAINER=\s+(\w.*)$/) if (/^MAINTAINER=/);
- ($portversion) = (m/^PORTVERSION=\s+(\w.*)$/) if (/^PORTVERSION=/);
}
close(MAKEFILE);
$maintainer = $maintaineraddr unless ($maintainer);
More information about the svn-ports-head
mailing list