Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2001 06:30:42 +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:  <861yrsunzx.wl@archon.local.idaemons.org>
In-Reply-To: <863dc8uofq.wl@archon.local.idaemons.org>
References:  <200103202054.f2KKsPt13806@freefall.freebsd.org> <863dc8uofq.wl@archon.local.idaemons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At Wed, 21 Mar 2001 06:21:13 +0900,
I wrote:
> Here's a patch against portlint3 that is equivalent to the changes
> I've just made on portlint2:

Oops.  That one was bogus.  Try this one..

--- portlint.pl.orig	Wed Mar 21 04:30:36 2001
+++ portlint.pl	Wed Mar 21 06:28:15 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 ($item =~ /^\./) {
+			&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$item\".");
+		}
+		if ($item =~ /(^|\.)core$/) {
+			&perror("FATAL: $dir/$item: for safety, be sure to cleanup ".
+					"core files before committing the port.");
+		}
+		if (-l "$dir/$item") {
+			&perror("Warning: $dir/$item: this is a symlink. ".
+					"CVS will ignore it.");
+		}
+		if (-z "$dir/$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;
 		}
 	}



(This fixes some bugs in the original code)

-- 
                     /
                    /__  __            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 cvs-all" in the body of the message




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