Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2001 06:21:13 +0900
From:      "Akinori MUSHA" <knu@iDaemons.org>
To:        mharo@FreeBSD.org, ports@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: ports/devel/portlint Makefile ports/devel/portlint/src         portlint.pl
Message-ID:  <863dc8uofq.wl@archon.local.idaemons.org>
In-Reply-To: <200103202054.f2KKsPt13806@freefall.freebsd.org>
References:  <200103202054.f2KKsPt13806@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Michael!

At Tue, 20 Mar 2001 12:54:25 -0800 (PST),
I wrote:
> knu         2001/03/20 12:54:24 PST
> 
>   Modified files:
>     devel/portlint       Makefile 
>     devel/portlint/src   portlint.pl 
>   Log:
>   Bring in the enhancements I submitted to mharo some time ago and bump
>   the version to 2.3.2.
>   
>   - Add checks for empty files, empty directories, core files, more
>   possible backup files, dotfiles, symlinks and CVS directories.
>   
>   - Do not assume PATCHDIR always includes "/files/".  Use the best
>   method to check whether a file is added to @checker as a patch file.
>   
>   - Some trivial message style fixes.

I've done this because not a few committers tend to commit those
unwanted garbage into the repository by mistake.  People, always use
portlint! :)


Here's a patch against portlint3 that is equivalent to the changes
I've just made on portlint2:

--- portlint.pl.orig	Wed Mar 21 04:30:36 2001
+++ portlint.pl	Wed Mar 21 05:15:32 2001
@@ -947,21 +947,42 @@
 	opendir(D, $dir) || errx(1, "opendir .");
 	@ls = readdir(D);
 	closedir(D);
+
+	if (@ls <= 2) {
+		&perror("FATAL: $dir: empty directory should be removed.");
+		$problem = 1;
+	}
+
 	foreach my $item (@ls) {
 		next if ($item =~ /^(\.|\.\.|CVS)$/);
 		warncrud("$dir/$item") if (-d "$dir/$item");
-		if ($item =~ /~$/) {
+		if ($item =~ /(~|\.bak)$/ || $item =~ /^#/) {
 			&perror("FATAL: $dir/$item: for safety, be sure to cleanup ".
 				"editor backup files before submitting/committing.");
 			$problem = 1;
 		}
-		if ($item =~ /\.rej$/ || $item =~ /\.orig$/) {
+		if ($item =~ /\.(orig|rej)$/) {
 			&perror("FATAL: $dir/$item: for safety, be sure to cleanup ".
 				"patch backup files before submitting/committing.");
 			$problem = 1;
 		}
-		if (-z "$item") {
-			&perror("FATAL: $item: empty file and should be removed.");
+		if (/^\./) {
+			&perror("Warning: $dir/$item: dotfiles are not preferred. ".
+					"If this file is a dotfile to be installed as an example, ".
+					"consider importing it as \"dot$_\".");
+		}
+		if (/(^|\.)core$/) {
+			&perror("FATAL: $dir/$item: for safety, be sure to cleanup ".
+					"core files before committing the port.");
+		}
+		if (-l $item) {
+			&perror("Warning: $dir/$item: this is a symlink. ".
+					"CVS will ignore it.");
+		}
+		if (-z $item) {
+			&perror("FATAL: $dir/$item: empty file should be removed. ".
+				    "If it still needs to be there, put a dummy comment ".
+					"to state that the file is intentionally left empty.");
 			$problem = 1;
 		}
 	}


Michael, please merge it into portlint3 in progress! :)


Regards,

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"We're only at home when we're on the run, on the wing, on the fly"

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863dc8uofq.wl>