FreeBSD Bugzilla – Attachment 117713 Details for
Bug 159841
Add functionality to addport -- check for any duplicates before commit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
addport-dupecheck.diff
addport-dupecheck.diff (text/plain), 1.90 KB, created by
Chris Rees
on 2011-08-17 17:40:08 UTC
(
hide
)
Description:
addport-dupecheck.diff
Filename:
MIME Type:
Creator:
Chris Rees
Created:
2011-08-17 17:40:08 UTC
Size:
1.90 KB
patch
obsolete
>Index: addport >=================================================================== >RCS file: /home/pcvs/ports/Tools/scripts/addport,v >retrieving revision 1.57 >diff -u -r1.57 addport >--- addport 27 Jul 2011 17:18:26 -0000 1.57 >+++ addport 11 Aug 2011 12:41:41 -0000 >@@ -56,7 +56,7 @@ > > my %opts; > >-getopts('abc:d:fh:il:L:M:mns:tu:', \%opts); >+getopts('abc:d:fh:il:L:M:mns:tu:y', \%opts); > > my $autofill_l = $opts{'l'}; > my $autofill_L = $opts{'L'}; >@@ -76,6 +76,7 @@ > my $nomkdir = $opts{'m'}; > my $addlchk = $opts{'a'}; > my $nofetch = $opts{'f'}; >+my $nocheckexist = $opts{'y'}; > my $currentdir = abs_path("."); > my %l10nprefix = ( > 'chinese' => 'zh-', >@@ -180,6 +181,38 @@ > exit 1; > } > >+# check the port doesn't exist already >+ >+unless ($nocheckexist) { >+ 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"; >+ my @namepart; >+ foreach (split(/\,/, $dir)) { >+ s/^.*\///; >+ foreach (split(/[-_]/)) { >+ next if length () <=2 or /^rubygem$/; >+ push(@namepart, $_); >+ } >+ } >+ open(MODULES_FILE, "< $tmpdir/modules") or errx(1, "Modules file in $tmpdir unreadable."); >+ while (my $line = <MODULES_FILE>) { >+ next if $line =~ /^#/; >+ foreach my $dpart (@namepart) { >+ if ($line =~ /^[^ ]*\b$dpart\b/i) { >+ $line =~ s/\s+/ /g; >+ print "$dpart matches $line\n"; >+ $found = 1; >+ } >+ } >+ } >+ if ($found) { >+ prompt ("Possible duplicates found -- still OK?") >+ and errx(1, "Investigating duplicates"); >+ } >+} >+ > # make sure we're in the right place. > chdir $currentdir; > my @dirs = split(/\,/, $dir); >@@ -448,6 +481,7 @@ > for downloading distfiles. > -t Do more port testing. Requires -a. > -u user Use a different username (default: $u). >+ -y Skip the check for similarly named ports. > > ENVIRONMENT VARIABLES > $0 supports the following environment variables:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 159841
: 117713