diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2016-09-08 12:49:02 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-09-08 12:49:02 +0000 |
commit | 9d7a60691558af7b2968ff2305b2fbf584e7f7a5 (patch) | |
tree | 43134c53a724a3c5c829e1cdb87b77441135c26c /Tools | |
parent | dfaa946400377a246e16ca158f5cbcd5bde364b1 (diff) |
Use make(1) to extract variables from a Makefile, not grep.
PR: 212486
Submitted by: mat
Approved by: crees (maintainer)
Sponsored by: Absolight
Notes
Notes:
svn path=/head/; revision=421545
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 d7e4eef88158..a53c19a0b8ab 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); |