Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Aug 2012 12:02:28 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r303131 - head/Tools/scripts
Message-ID:  <201208251202.q7PC2StR034758@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sat Aug 25 12:02:28 2012
New Revision: 303131
URL: http://svn.freebsd.org/changeset/ports/303131

Log:
  Fix the -y option to test for possible duplicate ports; use INDEX instead of
  modules file that was removed.
  
  It's fast, use it!

Modified:
  head/Tools/scripts/addport

Modified: head/Tools/scripts/addport
==============================================================================
--- head/Tools/scripts/addport	Sat Aug 25 12:01:11 2012	(r303130)
+++ head/Tools/scripts/addport	Sat Aug 25 12:02:28 2012	(r303131)
@@ -169,9 +169,9 @@ if ($dir eq "") {
 
 if ($checkexist) {
 	my $found = 0;
-	print ">> Checking out modules file to scan for duplicates...";
-#	system("$cvs -q co -p modules > $tmpdir/modules") && errx(1, "Could not checkout CVSROOT/modules.");
-	print " [DONE]\n";
+	print ">> Fetching INDEX to scan for duplicates...\n";
+	my $indexfile = "$tmpdir/" . `$make -C $portsdir -V INDEXFILE`;
+	system("$make -C /usr/ports INDEXDIR=$tmpdir fetchindex") && errx(1, "Could not fetch INDEX file.");
 	my @namepart;
 	foreach (split(/\,/, $dir)) {
 		s/^.*\///;
@@ -180,9 +180,10 @@ if ($checkexist) {
 			push(@namepart, $_);
 		}
 	}
-	open(MODULES_FILE, "< $tmpdir/modules") or errx(1, "Modules file in $tmpdir unreadable.");
-	while (my $line = <MODULES_FILE>) {
-		next if $line =~ /^#/;
+	open(INDEXFILE, "< $indexfile") or errx(1, "$indexfile unreadable.");
+	while (my $line = <INDEXFILE>) {
+		$line =~ m,^[^|]*\|/usr/ports/[^/]*/([^|]*)\|,;
+		$line = $1;
 		foreach my $dpart (@namepart) {
 			if ($line =~ /^[^ ]*\b$dpart\b/i) {
 				$line =~ s/\s+/ /g;



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