summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-10-15 01:19:48 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-10-15 01:19:48 +0000
commit8b45fb5ff2725af620f263efaeddec20277d2675 (patch)
tree88b685da13ad8d3d078a3ca18fc2da6b5f89f3fc /misc
parentUpdate to 1.2.8 (diff)
Prevent infinite loop in master port detection code.
Notes
Notes: svn path=/head/; revision=68068
Diffstat (limited to 'misc')
-rw-r--r--misc/porteasy/Makefile2
-rw-r--r--misc/porteasy/src/porteasy.pl12
2 files changed, 10 insertions, 4 deletions
diff --git a/misc/porteasy/Makefile b/misc/porteasy/Makefile
index 8518d8215ea9..c7c9faa3ed8e 100644
--- a/misc/porteasy/Makefile
+++ b/misc/porteasy/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= porteasy
-PORTVERSION= 2.7.3
+PORTVERSION= 2.7.4
CATEGORIES= misc
MASTER_SITES= # none
DISTFILES= # none
diff --git a/misc/porteasy/src/porteasy.pl b/misc/porteasy/src/porteasy.pl
index 199f9f5f214b..3ee5793aab2f 100644
--- a/misc/porteasy/src/porteasy.pl
+++ b/misc/porteasy/src/porteasy.pl
@@ -33,7 +33,7 @@ use strict;
use Fcntl;
use Getopt::Long;
-my $VERSION = "2.7.3";
+my $VERSION = "2.7.4";
my $COPYRIGHT = "Copyright (c) 2000-2002 Dag-Erling Smørgrav. " .
"All rights reserved.";
@@ -461,7 +461,6 @@ sub find_master($) {
my $port = shift; # Port
local *FILE; # File handle
- my $master; # Master directory
if ($masterport{$port}) {
return $masterport{$port};
@@ -473,6 +472,8 @@ sub find_master($) {
open(FILE, "$portsdir/$port/Makefile")
or bsd::err(1, "unable to read Makefile for $port");
while (<FILE>) {
+ my $master; # Master directory
+
if (/^(?:MAIN|MASTER)DIR\s*=\s*(\S+)\s*$/) {
$master = $1;
} elsif (/^\.?include \"([^\"]+)\/Makefile(?:[^\/\"]*)\"\s*$/) {
@@ -484,8 +485,13 @@ sub find_master($) {
$master =~ s|/+|/|g;
1 while ($master =~ s|/[^\./]*/\.\./|/|);
$master =~ s|^/||;
+ $master =~ s|/$||;
+ if ($master eq $port) {
+ bsd::warnx("master port heuristics failed for %s", $port);
+ next;
+ }
if ($master !~ m|^[^/]+/[^/]+$|) {
- bsd::warn("invalid master for %s: %s", $port, $master);
+ bsd::warnx("invalid master for %s: %s", $port, $master);
next;
}
close(FILE);