View | Details | Raw Unified | Return to bug 159841
Collapse All | Expand All

(-)addport (-1 / +35 lines)
Lines 56-62 Link Here
56
56
57
my %opts;
57
my %opts;
58
58
59
getopts('abc:d:fh:il:L:M:mns:tu:', \%opts);
59
getopts('abc:d:fh:il:L:M:mns:tu:y', \%opts);
60
60
61
my $autofill_l = $opts{'l'};
61
my $autofill_l = $opts{'l'};
62
my $autofill_L = $opts{'L'};
62
my $autofill_L = $opts{'L'};
Lines 76-81 Link Here
76
my $nomkdir = $opts{'m'};
76
my $nomkdir = $opts{'m'};
77
my $addlchk = $opts{'a'};
77
my $addlchk = $opts{'a'};
78
my $nofetch = $opts{'f'};
78
my $nofetch = $opts{'f'};
79
my $nocheckexist = $opts{'y'};
79
my $currentdir = abs_path(".");
80
my $currentdir = abs_path(".");
80
my %l10nprefix = (
81
my %l10nprefix = (
81
	'chinese'	=> 'zh-',
82
	'chinese'	=> 'zh-',
Lines 180-185 Link Here
180
	exit 1;
181
	exit 1;
181
}
182
}
182
183
184
# check the port doesn't exist already
185
186
unless ($nocheckexist) {
187
	my $found = 0;
188
	print ">> Checking out modules file to scan for duplicates...";
189
	system("$cvs -q co -p modules > $tmpdir/modules") && errx(1, "Could not checkout CVSROOT/modules.");
190
	print " [DONE]\n";
191
	my @namepart;
192
	foreach (split(/\,/, $dir)) {
193
		s/^.*\///;
194
		foreach (split(/[-_]/)) {
195
			next if length () <=2 or /^rubygem$/;
196
			push(@namepart, $_);
197
		}
198
	}
199
	open(MODULES_FILE, "< $tmpdir/modules") or errx(1, "Modules file in $tmpdir unreadable.");
200
	while (my $line = <MODULES_FILE>) {
201
		next if $line =~ /^#/;
202
		foreach my $dpart (@namepart) {
203
			if ($line =~ /^[^ ]*\b$dpart\b/i) {
204
				$line =~ s/\s+/ /g;
205
				print "$dpart matches $line\n";
206
				$found = 1;
207
			}
208
		}
209
	}
210
	if ($found) {
211
		prompt ("Possible duplicates found -- still OK?")
212
			and errx(1, "Investigating duplicates");
213
	}
214
}
215
183
# make sure we're in the right place.
216
# make sure we're in the right place.
184
chdir $currentdir;
217
chdir $currentdir;
185
my @dirs = split(/\,/, $dir);
218
my @dirs = split(/\,/, $dir);
Lines 448-453 Link Here
448
			for downloading distfiles.
481
			for downloading distfiles.
449
	-t		Do more port testing.  Requires -a.
482
	-t		Do more port testing.  Requires -a.
450
	-u user		Use a different username (default: $u).
483
	-u user		Use a different username (default: $u).
484
	-y		Skip the check for similarly named ports.
451
485
452
ENVIRONMENT VARIABLES
486
ENVIRONMENT VARIABLES
453
	$0 supports the following environment variables:
487
	$0 supports the following environment variables:

Return to bug 159841