diff options
author | mat <mat@FreeBSD.org> | 2016-09-08 20:49:02 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2016-09-08 20:49:02 +0800 |
commit | cbf3cfd374e3b52aae799d4c2344731b2f69d402 (patch) | |
tree | 43134c53a724a3c5c829e1cdb87b77441135c26c /Tools | |
parent | 3b82ccb37d476efe6718f22c38d07ff86f076d76 (diff) | |
download | freebsd-ports-graphics-cbf3cfd374e3b52aae799d4c2344731b2f69d402.tar.gz freebsd-ports-graphics-cbf3cfd374e3b52aae799d4c2344731b2f69d402.tar.zst freebsd-ports-graphics-cbf3cfd374e3b52aae799d4c2344731b2f69d402.zip |
Use make(1) to extract variables from a Makefile, not grep.
PR: 212486
Submitted by: mat
Approved by: crees (maintainer)
Sponsored by: Absolight
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/addport | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index d7e4eef8815..a53c19a0b8a 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -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); |