Quellcode durchsuchen

Add support for the PL_SVN_IGNORE environment variable.

PR:		177043
Submitted by:	tota
marcus vor 11 Jahren
Ursprung
Commit
2cf35902cb
2 geänderte Dateien mit 16 neuen und 3 gelöschten Zeilen
  1. 3 3
      portlint.1
  2. 13 0
      portlint.pl

+ 3 - 3
portlint.1

@@ -130,10 +130,10 @@ This types of message is used in verbose mode
 .Sh ENVIRONMENT
 The following environment variables affect the execution of
 .Nm :
-.Bl -tag -width ".Ev PL_CVS_IGNORE"
-.It Ev PL_CVS_IGNORE
+.Bl -tag -width ".Ev PL_SVN_IGNORE"
+.It Ev PL_SVN_IGNORE
 Set to a Perl-compatible regular expression, of patterns
-to ignore when checking to see if files are in the CVS
+to ignore when checking to see if files are in the SVN
 repository.  For example,
 .Li '^\ed+$|^pr-patch$' .
 .It Ev PORTSDIR

+ 13 - 0
portlint.pl

@@ -161,6 +161,7 @@ foreach my $i (@osdep) {
 
 # The PORTSDIR environment variable overrides our defaults.
 $portsdir = $ENV{PORTSDIR} if ( defined $ENV{'PORTSDIR'} );
+$ENV{'PL_SVN_IGNORE'} //= '';
 my $mfile_moved = "${portsdir}/MOVED";
 my $mfile_uids = "${portsdir}/UIDs";
 my $mfile_gids = "${portsdir}/GIDs";
@@ -367,6 +368,8 @@ if ($committer) {
 		} elsif ($_ eq '.svn' && -d) {
 			&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
 				"Subversion files before committing the port.");
+
+			$File::Find::prune = 1;
 		} elsif ($_ eq 'CVS' && -d) {
 			if ($newport) {
 				&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
@@ -374,6 +377,16 @@ if ($committer) {
 			}
 
 			$File::Find::prune = 1;
+		} elsif (-f) {
+			my $fullpath = $makevar{'.CURDIR'}.'/'.$fullname;
+			my $result = `svn status $fullpath`;
+
+			chomp $result;
+			if (substr($result, 0, 1) eq '?') {
+				&perror("FATAL", "", -1, "$fullname not under SVN.")
+					unless (eval { /$ENV{'PL_SVN_IGNORE'}/, 1 } &&
+						/$ENV{'PL_SVN_IGNORE'}/);
+			}
 		}
 	}