From 0d3c4d96b118b87b5bebc8c2fb738b6a3f0cdb79 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 11 Jan 2003 08:18:48 +0000 Subject: Add a simple check for MAINTAINER not to include multiple addresses or comments. Approved by: portmgr --- devel/portlint/Makefile | 2 +- devel/portlint/src/portlint.pl | 8 +++++++- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 8 +++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/devel/portlint/Makefile b/devel/portlint/Makefile index 5ea72aca047a..151e11c06857 100644 --- a/devel/portlint/Makefile +++ b/devel/portlint/Makefile @@ -9,7 +9,7 @@ PORTNAME= portlint PORTVERSION= 2.3.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= # none DISTFILES= # none diff --git a/devel/portlint/src/portlint.pl b/devel/portlint/src/portlint.pl index 16521143c593..08b13be587c8 100644 --- a/devel/portlint/src/portlint.pl +++ b/devel/portlint/src/portlint.pl @@ -1199,7 +1199,13 @@ PATCH_SITES PATCHFILES PATCH_DIST_STRIP &checkearlier($file, $tmp, @varnames); $tmp = "\n" . $tmp; - if ($tmp =~ /\nMAINTAINER\??=[^\n]+/) { + if ($tmp =~ /\nMAINTAINER\??=([^\n]+)/) { + my $addr = $1; + $addr =~ s/^\s*//; + $addr =~ s/\s*$//; + if ($addr =~ /[\s,<>()]/) { + &perror("FATAL: MAINTAINER should be a single address without comment."); + } $tmp =~ s/\nMAINTAINER\??=[^\n]+//; } elsif ($whole !~ /\nMAINTAINER[?]?=/) { &perror("FATAL: no MAINTAINER listed in $file.") unless ($slaveport && $makevar{MAINTAINER} ne ''); diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 5ea72aca047a..151e11c06857 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -9,7 +9,7 @@ PORTNAME= portlint PORTVERSION= 2.3.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= # none DISTFILES= # none diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl index 16521143c593..08b13be587c8 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -1199,7 +1199,13 @@ PATCH_SITES PATCHFILES PATCH_DIST_STRIP &checkearlier($file, $tmp, @varnames); $tmp = "\n" . $tmp; - if ($tmp =~ /\nMAINTAINER\??=[^\n]+/) { + if ($tmp =~ /\nMAINTAINER\??=([^\n]+)/) { + my $addr = $1; + $addr =~ s/^\s*//; + $addr =~ s/\s*$//; + if ($addr =~ /[\s,<>()]/) { + &perror("FATAL: MAINTAINER should be a single address without comment."); + } $tmp =~ s/\nMAINTAINER\??=[^\n]+//; } elsif ($whole !~ /\nMAINTAINER[?]?=/) { &perror("FATAL: no MAINTAINER listed in $file.") unless ($slaveport && $makevar{MAINTAINER} ne ''); -- cgit