svn commit: r303131 - head/Tools/scripts
Chris Rees
crees at FreeBSD.org
Sat Aug 25 12:02:29 UTC 2012
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;
More information about the svn-ports-all
mailing list