Date: Thu, 8 Sep 2016 12:49:02 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r421545 - head/Tools/scripts Message-ID: <201609081249.u88Cn22A033505@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609081249.u88Cn22A033505>