diff options
author | crees <crees@FreeBSD.org> | 2012-08-25 20:02:28 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2012-08-25 20:02:28 +0800 |
commit | db494dd1990621420aa4b014dfdae8930e156cff (patch) | |
tree | ec3b8c19f283d16c5f8f9391be4c51b4e17d485b | |
parent | 12bc1046ceeaadb904403ad25d15310fc98adb83 (diff) | |
download | freebsd-ports-gnome-db494dd1990621420aa4b014dfdae8930e156cff.tar.gz freebsd-ports-gnome-db494dd1990621420aa4b014dfdae8930e156cff.tar.zst freebsd-ports-gnome-db494dd1990621420aa4b014dfdae8930e156cff.zip |
Fix the -y option to test for possible duplicate ports; use INDEX instead of
modules file that was removed.
It's fast, use it!
-rwxr-xr-x | Tools/scripts/addport | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index d615461d9f21..0ef5527e1988 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -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; |