Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Dec 2000 00:51:05 +0900
From:      "Akinori MUSHA" <knu@iDaemons.org>
To:        Maxim Sobolev <sobomax@FreeBSD.ORG>
Cc:        Akinori MUSHA <knu@idaemons.org>, Michael Haro <mharo@FreeBSD.ORG>, FreeBSD-ports <freebsd-ports@FreeBSD.ORG>
Subject:   Re: portlint update
Message-ID:  <86sno4w5g6.wl@archon.local.idaemons.org>
In-Reply-To: <3A2B895D.D67E403A@FreeBSD.org>
References:  <86u28kwghs.wl@archon.local.idaemons.org> <3A2B895D.D67E403A@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At Mon, 04 Dec 2000 14:09:02 +0200,
sobomax wrote:
> Some time ago (3 months) I submitted patch which detects different misbehaviour - direct usage of ldconfig in pkg-plist. If you can,
> please merge this patch with yours before comitting.

Thanks, merged.  And I've also improved the "MASTER_SITE_*" checker.
Now portlint will dynamically read bsd.sites.mk and make a proper
suggestion.

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"We're only at home when we're on the run, on the wing, on the fly"

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/portlint/Makefile,v
retrieving revision 1.41
diff -u -r1.41 Makefile
--- Makefile	2000/11/10 07:43:54	1.41
+++ Makefile	2000/12/04 11:06:39
@@ -8,7 +8,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.2.3.1
+PORTVERSION=	2.2.3.2
 CATEGORIES=	devel
 MASTER_SITES=	# none
 DISTFILES=	# none
Index: src/portlint.1
===================================================================
RCS file: /home/ncvs/ports/devel/portlint/src/portlint.1,v
retrieving revision 1.5
diff -u -r1.5 portlint.1
--- src/portlint.1	2000/04/25 21:33:42	1.5
+++ src/portlint.1	2000/12/04 11:36:35
@@ -38,7 +38,7 @@
 Perform additional checks for extra files, such as
 .Pa scripts/*
 and
-.Pa pkg/* .
+.Pa pkg-* .
 .It Fl b
 Warn the use of
 .Pa $(VARIABLE) .
Index: src/portlint.pl
===================================================================
RCS file: /home/ncvs/ports/devel/portlint/src/portlint.pl,v
retrieving revision 1.23
diff -u -r1.23 portlint.pl
--- src/portlint.pl	2000/11/10 07:20:43	1.23
+++ src/portlint.pl	2000/12/04 15:43:34
@@ -22,6 +22,7 @@
 
 use vars qw/ $opt_a $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /;
 use Getopt::Std;
+use IPC::Open2;
 #use strict;
 
 my ($err, $warn);
@@ -72,7 +73,7 @@
 sub usage {
 	print STDERR <<EOF;
 usage: $prog [-abctvN] [-B#] [port_directory]
-	-a	additional check for scripts/* and pkg/*
+	-a	additional check for scripts/* and pkg-*
 	-b	warn \$(VARIABLE)
 	-c	committer mode
 	-v	verbose mode
@@ -146,17 +147,15 @@
 chdir "$portdir" || die "$portdir: $!";
 
 # get make vars
-my $cmd = "make $makeenv MASTER_SITE_BACKUP=''";
 my @varlist =  (split(/\s+/, <<EOF));
 PORTNAME PORTVERSION PORTREVISION PORTEPOCH PKGNAME PKGNAMEPREFIX
 PKGNAMESUFFIX DISTNAME DISTFILES CATEGORIES MASTERDIR MAINTAINER
 MASTER_SITES WRKDIR WRKSRC NO_WRKSUBDIR PATCHDIR SCRIPTDIR FILESDIR
-PKGDIR COMMENT DESCR PLIST MD5_FILE .CURDIR
+PKGDIR COMMENT DESCR PLIST MD5_FILE .CURDIR INSTALLS_SHLIB
 EOF
 
-for (@varlist) {
-	$cmd .= " -V $_";
-}
+my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist);
+
 my %makevar;
 my $i = 0;
 for (split(/\n/, `$cmd`)) {
@@ -196,150 +195,36 @@
 }
 
 # This list should be in sync with bsd.sites.mk
-foreach my $i (split("\n", <<EOF)) {
-XCONTRIB	ftp://crl.dec.com/pub/X11/contrib/
-XCONTRIB	ftp://uiarchive.uiuc.edu/pub/X11/contrib/
-XCONTRIB	ftp://ftp.gwdg.de/pub/x11/x.org/contrib/
-XCONTRIB	ftp://ftp.duke.edu/pub/X11/contrib/
-XCONTRIB	ftp://ftp.x.org/contrib/
-XCONTRIB	ftp://ftp.sunet.se/pub/X11/contrib/
-XCONTRIB	ftp://ftp.kddlabs.co.jp/X11/contrib/
-XCONTRIB	ftp://mirror.xmission.com/X/contrib/
-XCONTRIB	ftp://ftp2.x.org/contrib/
-XCONTRIB	ftp://sunsite.sut.ac.jp/pub/archives/X11/contrib/
-XCONTRIB	ftp://ftp.is.co.za/x/contrib/
-XCONTRIB	ftp://ftp.sunet.se/pub/X11/contrib/
-XCONTRIB	ftp://ftp.huji.ac.il/mirror/X11/contrib/
-XFREE	ftp://ftp.xfree86.org/pub/XFree86/
-XFREE	ftp://ftp.freesoftware.com/pub/XFree86/
-XFREE	ftp://ftp.lip6.fr/pub/X11/XFree86/XFree86-
-XFREE	ftp://ftp.cs.tu-berlin.de/pub/X/XFree86/
-XFREE	ftp://sunsite.doc.ic.ac.uk/packages/XFree86/
-XFREE	http://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.xfree86.org/XFree86/
-GNU	ftp://ftp.gnu.org/gnu/
-GNU	ftp://ftp.freesoftware.com/pub/gnu/
-GNU	ftp://ftp.digital.com/pub/GNU/
-GNU	ftp://ftp.uu.net/archive/systems/gnu/
-GNU	ftp://ftp.de.uu.net/pub/gnu/
-GNU	ftp://ftp.sourceforge.net/pub/mirrors/gnu/
-GNU	ftp://ftp.funet.fi/pub/gnu/prep/
-GNU	ftp://ftp.leo.org/pub/comp/os/unix/gnu/
-GNU	ftp://ftp.digex.net/pub/gnu/
-GNU	ftp://ftp.wustl.edu/systems/gnu/
-GNU	ftp://ftp.kddlabs.co.jp/pub/gnu/
-PERL_CPAN	ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.cpan.org/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.freesoftware.com/pub/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.sourceforge.net/pub/mirrors/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://bioinfo.weizmann.ac.il/pub/software/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://csociety-ftp.ecn.purdue.edu/archive0/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.kddlabs.co.jp/lang/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.sunet.se/pub/lang/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.auckland.ac.nz/pub/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://mirror.hiwaay.net/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.isu.net.sa/pub/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.bora.net/pub/CPAN/modules/by-module/
-PERL_CPAN	ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/modules/by-module/
-PERL_CPAN	http://www.cpan.dk/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.cs.colorado.edu/pub/perl/CPAN/modules/by-module/
-PERL_CPAN	ftp://cpan.pop-mg.com.br/pub/CPAN/modules/by-module/
-PERL_CPAN	ftp://ftp.is.co.za/programming/perl/CPAN/modules/by-module/
-TEX_CTAN	ftp://ftp.freesoftware.com/pub/tex/ctan/
-TEX_CTAN	ftp://wuarchive.wustl.edu/packages/TeX/
-TEX_CTAN	ftp://ftp.funet.fi/pub/TeX/CTAN/
-TEX_CTAN	ftp://ctan.unsw.edu.au/tex-archive/
-TEX_CTAN	ftp://ftp.cise.ufl.edu/tex-archive/
-TEX_CTAN	ftp://ftp.tex.ac.uk/tex-archive/
-TEX_CTAN	ftp://shadowmere.student.utwente.nl/pub/CTAN/
-TEX_CTAN	ftp://ftp.kddlabs.co.jp/CTAN/
-TEX_CTAN	ftp://sunsite.auc.dk/pub/tex/ctan/
-TEX_CTAN	ftp://ctan.tug.org/tex-archive/
-TEX_CTAN	ftp://ftp.chg.ru/pub/TeX/CTAN/
-TEX_CTAN	ftp://ftp.dante.de/tex-archive/
-SUNSITE	ftp://metalab.unc.edu/pub/Linux/
-SUNSITE	ftp://ftp.freesoftware.com/pub/linux/sunsite/
-SUNSITE	ftp://ftp.sourceforge.net/pub/mirrors/metalab/Linux/
-SUNSITE	ftp://ftp.sun.ac.za/pub/linux/sunsite/
-SUNSITE	ftp://ftp.nuri.net/pub/Linux/
-SUNSITE	ftp://ftp.kddlabs.co.jp//Linux/metalab.unc.edu/
-SUNSITE	ftp://ftp.jaring.my/pub/Linux/
-SUNSITE	ftp://ftp.funet.fi/pub/Linux/mirrors/metalab/
-SUNSITE	ftp://ftp.archive.de.uu.net/pub/systems/Linux/Mirror.SunSITE/
-SUNSITE	ftp://sunsite.doc.ic.ac.uk/packages/linux/sunsite.unc-mirror/
-SUNSITE	ftp://uiarchive.cso.uiuc.edu/pub/systems/linux/sunsite/
-SUNSITE	ftp://ftp.cs.umn.edu/pub/Linux/sunsite/
-KDE	ftp://ftp.us.kde.org/pub/kde/
-KDE	ftp://ftp.sourceforge.net/pub/sourceforge/kde/
-KDE	ftp://ftp.kde.org/pub/kde/
-KDE	ftp://ftp.tuniv.szczecin.pl/pub/kde/
-KDE	ftp://ftp.kddlabs.co.jp/X11/kde/
-KDE	ftp://ftp2.sinica.edu.tw/pub5/wmgrs/kde/
-KDE	ftp://ftp.chg.ru/pub/X11/kde/
-KDE	ftp://ftp.synesis.net/pub/mirrors/kde/
-KDE	ftp://gd.tuwien.ac.at/hci/kde/
-KDE	ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/
-KDE	ftp://ftp.twoguys.org/pub/kde/
-KDE	ftp://ftp.dataplus.se/pub/linux/kde/
-KDE	ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/
-COMP_SOURCES	ftp://gatekeeper.dec.com/pub/usenet/comp.sources.
-COMP_SOURCES	ftp://ftp.kddlabs.co.jp/Unix/com.sources.
-COMP_SOURCES	ftp://ftp.uu.net/usenet/comp.sources.
-COMP_SOURCES	ftp://ftp.funet.fi/pub/archive/comp.sources.
-COMP_SOURCES	ftp://rtfm.mit.edu/pub/usenet/comp.sources.
-GNOME	ftp://ftp.gnome.org/pub/GNOME/
-GNOME	ftp://download.sourceforge.net/pub/mirrors/gnome/
-GNOME	ftp://rpmfind.net/linux/gnome.org/
-GNOME	ftp://ftp.mirror.ac.uk/sites/ftp.gnome.org/pub/GNOME/
-GNOME	ftp://slave.opensource.captech.com/gnome/
-GNOME	ftp://ftp.snoopy.net/pub/mirrors/GNOME/
-GNOME	ftp://ftp.kddlabs.co.jp/X11/GNOME/
-GNOME	ftp://ftp.sunet.se/pub/X11/GNOME/
-GNOME	ftp://ftp.cybertrails.com/pub/gnome/
-GNOME	ftp://ftp2.sinica.edu.tw/pub5/gnome/
-GNOME	ftp://gnomeftp.blue-labs.org/pub/gnome/
-GNOME	ftp://ftp.informatik.uni-bonn.de/pub/os/unix/gnome/
-GNOME	ftp://ftp.tas.gov.au/gnome/
-AFTERSTEP	ftp://ftp.afterstep.org/
-AFTERSTEP	ftp://ftp.digex.net/pub/X11/window-managers/afterstep/
-AFTERSTEP	ftp://ftp.kddlabs.co.jp/X11/AfterStep/
-AFTERSTEP	ftp://ftp.math.uni-bonn.de/pub/mirror/ftp.afterstep.org/pub/
-AFTERSTEP	ftp://ftp.dti.ad.jp/pub/X/AfterStep/
-WINDOWMAKER	ftp://ftp.windowmaker.org/pub/
-WINDOWMAKER	ftp://ftp.goldweb.com.au/pub/WindowMaker/
-WINDOWMAKER	ftp://ftp.kddlabs.co.jp/X11/window_managers/windowmaker/
-WINDOWMAKER	ftp://ftp.ameth.org/pub/mirrors/ftp.windowmaker.org/
-WINDOWMAKER	ftp://ftp.minet.net/pub/windowmaker/
-WINDOWMAKER	ftp://ftp.dti.ad.jp/pub/X/WindowMaker/
-PORTS_JP	ftp://ports.jp.FreeBSD.org/pub/FreeBSD-jp/ports-jp/LOCAL_PORTS/
-PORTS_JP	ftp://ftp4.jp.FreeBSD.org/pub/FreeBSD-jp/ports-jp/LOCAL_PORTS/
-PORTS_JP	ftp://ftp.ics.es.osaka-u.ac.jp/pub/mirrors/FreeBSD-jp/ports-jp/LOCAL_PORTS/
-TCLTK	ftp://ftp.scriptics.com/pub/tcl/
-TCLTK	ftp://mirror.neosoft.com/pub/tcl/mirror/ftp.scriptics.com/
-TCLTK	ftp://sunsite.utk.edu/pub/tcl/
-TCLTK	ftp://ftp.funet.fi/pub/languages/tcl/tcl/
-TCLTK	ftp://ftp.uu.net/languages/tcl/
-TCLTK	ftp://ftp.kddlabs.co.jp/lang/tcl/ftp.scriptics.com/
-TCLTK	ftp://ftp.cs.tu-berlin.de/pub/tcl/distrib/
-TCLTK	ftp://ftp.srcc.msu.su/mirror/ftp.scriptics.com/pub/tcl/
-TCLTK	ftp://ftp.lip6.fr/pub/tcl/distrib/
-SOURCEFORGE	ftp://download.sourceforge.net/pub/sourceforge/
-SOURCEFORGE	http://download.sourceforge.net/
-SOURCEFORGE	ftp://ftp.kddlabs.co.jp/sourceforge/
-RUBY	ftp://ftp.netlab.co.jp/pub/lang/ruby/
-RUBY	ftp://ftp.TokyoNet.AD.JP/pub/misc/ruby/
-RUBY	ftp://ftp.iij.ad.jp/pub/lang/ruby/
-RUBY	ftp://blade.nagaokaut.ac.jp/pub/lang/ruby/
-RUBY	ftp://ftp.krnet.ne.jp/pub/ruby/
-RUBY	ftp://mirror.nucba.ac.jp/mirror/ruby/
-THEMES	ftp://ftp.themes.org/pub/themes/
-THEMES	ftp://ftp.tuwien.ac.at/opsys/linux/themes.org/
+$sites_mk = "$portsdir/Mk/bsd.sites.mk";
+open(MK, $sites_mk) || die "$sites_mk: $!";
+my @site_groups = grep($_ = /^MASTER_SITE_(\w+)/ && $1, <MK>);
+close(MK);
+
+my $cmd = join(' -V MASTER_SITE_', "make $makeenv -f - all", @site_groups);
+
+my $i = 0;
+
+open2(IN, OUT, $cmd);
+
+print OUT <<EOF;
+all:
+	# do nothing
+
+.include "$sites_mk"
 EOF
-	my ($j, $k) = split(/\t+/, $i);
-	$predefined{$k} = $j;
+
+close(OUT);
+
+while (<IN>) {
+	my $g = $site_groups[$i];
+	for my $s (split()) {
+		$predefined{$s} = $g;
+	}
+	$i++;
 }
 
+close(IN);
+
 #
 # check for files.
 #
@@ -347,11 +232,11 @@
 my %checker = ($makevar{COMMENT}, 'checkdescr', $makevar{DESCR}, 'checkdescr',
 		'Makefile', 'checkmakefile', $makevar{MD5_FILE}, 'TRUE');
 if ($extrafile) {
-	foreach my $i ((<scripts/*>, <pkg/*>)) {
+	foreach my $i ((<scripts/*>, <pkg-*>)) {
 		next if (! -T $i);
 		next if (defined $checker{$i});
-		if ($i =~ /pkg\/PLIST$/
-		 || ($multiplist && $i =~ /pkg\/PLIST/)) {
+		if ($i =~ /pkg-plist$/
+		 || ($multiplist && $i =~ /pkg-plist/)) {
 			unshift(@checker, $i);
 			$checker{$i} = 'checkplist';
 		} else {
@@ -360,7 +245,7 @@
 		}
 	}
 }
-foreach my $i (<patches/patch-??>) {
+foreach my $i (<files/patch-??>) {
 	next if (! -T $i);
 	next if (defined $checker{$i});
 	push(@checker, $i);
@@ -402,7 +287,7 @@
 exit $err;
 
 #
-# pkg/COMMENT, pkg/DESCR
+# pkg-comment, pkg-descr
 #
 sub checkdescr {
 	my($file) = @_;
@@ -434,7 +319,7 @@
 			"other local characters.  $file should be ".
 			"plain ascii file.");
 	}
-	if ($file =~ m/DESCR/ && $tmp =~ m,http://,) {
+	if ($file =~ m/pkg-descr/ && $tmp =~ m,http://,) {
 		my $has_url = 0;
 		my $has_www = 0;
 		foreach my $line (grep($_ =~ "http://", split(/\n+/, $tmp))) {
@@ -448,16 +333,16 @@
 			&perror("FATAL: $file: contains a URL but no WWW:");
 		}
 	}
-	if ($file =~ m/COMMENT/) {
+	if ($file =~ m/pkg-comment/) {
 		if (($tmp !~ /^["0-9A-Z]/) || ($tmp =~ m/\.$/)) {
-			&perror("WARN: pkg/COMMENT should begin with a capital, and end without a period");
+			&perror("WARN: pkg-comment should begin with a capital, and end without a period");
 		}
 	}
 	close(IN);
 }
 
 #
-# pkg/PLIST
+# pkg-plist
 #
 sub checkplist {
 	my($file) = @_;
@@ -501,22 +386,27 @@
 				$inforemoveseen = $.;
 				push(@unexec_info, $1);
 			} elsif ($_ =~ /^\@(exec|unexec)/) {
-				if ($ldconfigwithtrue
-				 && /ldconfig/
-				 && !/\/usr\/bin\/true/) {
-					&perror("FATAL: $file $.: ldconfig ".
-						"must be used with ".
-						"\"||/usr/bin/true\".");
+				if (/ldconfig/) {
+					if ($ldconfigwithtrue
+					 && !/\/usr\/bin\/true/) {
+						&perror("FATAL: $file $.: ldconfig ".
+							"must be used with ".
+							"\"||/usr/bin/true\".");
+					}
+				&perror("WARN: $file $.: possible ".
+					"direct use of ldconfig ".
+					"in PLIST found. use ".
+					"INSTALLS_SHLIB instead.");
 				}
 			} elsif ($_ =~ /^\@(comment)/) {
 				$rcsidseen++ if (/\$$rcsidstr[:\$]/);
 			} elsif ($_ =~ /^\@(owner|group)\s/) {
-				&perror("WARN: \@$1 should not be needed in PLIST");
+				&perror("WARN: \@$1 should not be needed in pkg-plist");
 			} elsif ($_ =~ /^\@(dirrm|option)/) {
 				; # no check made
 			} else {
 				&perror("WARN: $file $.: ".
-					"unknown PLIST directive \"$_\"");
+					"unknown pkg-plist directive \"$_\"");
 			}
 			next;
 		}
@@ -531,6 +421,11 @@
 				"please use USE_LIBTOOL in Makefile if possible");
 		}
 
+		if ($_ =~ /\.so(\.\d+)?$/ && $makevar{INSTALLS_SHLIB} eq '') {
+			&perror("WARN: $file $.: installing shared libraries, ".
+				"please define INSTALLS_SHLIB as appropriate");
+		}
+
 		if ($_ =~ /^info\/.*info(-[0-9]+)?$/) {
 			$infoseen = $.;
 			$infoafterinstall++ if ($infoinstallseen);
@@ -591,10 +486,10 @@
 	foreach my $if (@infofile) {
 		next if ($if =~ m/info-/);
 		if ($exec_install !~ m/\%D\/\Q$if\E/) {
-			&perror("FATAL: you need an '\@exec install-info \%D/$if \%D/info/dir' line in your PLIST");
+			&perror("FATAL: you need an '\@exec install-info \%D/$if \%D/info/dir' line in your pkg-plist");
 		}
 		if ($unexec_install !~ m/\%D\/$if/) {
-			&perror("FATAL: you need an '\@unexec install-info --delete \%D/$if \%D/info/dir' line in your PLIST");
+			&perror("FATAL: you need an '\@unexec install-info --delete \%D/$if \%D/info/dir' line in your pkg-plist");
 		}
 	}
 
@@ -1456,7 +1351,7 @@
 	# check MAN[1-9LN]
 	print "OK: checking MAN[0-9LN].\n" if ($verbose);
 	foreach my $i (keys %plistmanall) {
-		print "OK: PLIST MAN$i=$plistmanall{$i}\n" if ($verbose);
+		print "OK: pkg-plist MAN$i=$plistmanall{$i}\n" if ($verbose);
 	}
 	foreach my $i (split(//, $manchapters)) {
 		if ($tmp =~ /MAN\U$i\E=\s*([^\n]*)\n/) {
@@ -1476,16 +1371,16 @@
 					&perror("FATAL: duplicated manpage ".
 						"entry $j: content of ".
 						"MAN$i will be automatically ".
-						"added to PLIST.");
+						"added to pkg-plist.");
 				} elsif (!$automan && !grep($_ eq $j, @pman)) {
 					&perror("WARN: manpage $j in $file ".
-						"MAN$i but not in PLIST.");
+						"MAN$i but not in pkg-plist.");
 				}
 			}
 			foreach my $j (@pman) {
-				print "OK: checking $j (PLIST)\n" if ($verbose);
+				print "OK: checking $j (pkg-plist)\n" if ($verbose);
 				if (!grep($_ eq $j, @mman)) {
-					&perror("WARN: manpage $j in PLIST ".
+					&perror("WARN: manpage $j in pkg-plist ".
 						"but not in $file MAN$i.");
 				}
 			}
@@ -1699,16 +1594,18 @@
 
 sub is_predefined {
 	my($url) = @_;
-	my($site);
-	my($subdir);
-	if ($site = (grep($url =~ $_, keys %predefined))[0]) {
-		$url =~ /$site/;
-		$subdir = $';
-		$subdir =~ s/\/$//;
-		&perror("WARN: how about using ".
-			"\${MASTER_SITE_$predefined{$site}} with ".
-			"\"MASTER_SITE_SUBDIR=$subdir\", instead of \"$url\?");
-		return &TRUE;
+	my($site, $site_re);
+	my $subdir_re = quotemeta quotemeta '/%SUBDIR%/';
+	for my $site (keys %predefined) {
+		$site_re = quotemeta $site;
+		$site_re =~ s,$subdir_re,/(.*)/,;
+
+		if ($url =~ /$site_re/) {
+			&perror("WARN: how about using ".
+				"\"\${MASTER_SITE_$predefined{$site}}\" with ".
+				"\"MASTER_SITE_SUBDIR=$1\", instead of \"$url\?");
+			return &TRUE;
+		}
 	}
 	undef;
 }


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86sno4w5g6.wl>