From owner-freebsd-ports Tue Mar 20 13:23: 9 2001 Delivered-To: freebsd-ports@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 85ECB37B71E; Tue, 20 Mar 2001 13:22:54 -0800 (PST) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id BEF804D821; Wed, 21 Mar 2001 06:21:13 +0900 (JST) Date: Wed, 21 Mar 2001 06:21:13 +0900 Message-ID: <863dc8uofq.wl@archon.local.idaemons.org> From: "Akinori MUSHA" 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 In-Reply-To: <200103202054.f2KKsPt13806@freefall.freebsd.org> References: <200103202054.f2KKsPt13806@freefall.freebsd.org> User-Agent: Wanderlust/2.5.4 (Smooth) SEMI/1.14.2 (=?ISO-8859-1?Q?Daish=F2?= =?ISO-8859-1?Q?ji?=) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.2 - =?ISO-8859-1?Q?=22Daish=F2ji=22?=) Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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