Received: by mail.netbsd.org (Postfix, from userid 605) id 4ACA984DC1; Thu, 11 Aug 2022 18:55:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 83A8A84D84 for ; Thu, 11 Aug 2022 18:55:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id D1N_9i7IekLy for ; Thu, 11 Aug 2022 18:55:36 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id C1CAC84D1B for ; Thu, 11 Aug 2022 18:55:35 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B5AC5FB1A; Thu, 11 Aug 2022 18:55:35 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1660244135110370" MIME-Version: 1.0 Date: Thu, 11 Aug 2022 18:55:35 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/lintpkgsrc/files To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20220811185535.B5AC5FB1A@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1660244135110370 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Thu Aug 11 18:55:35 UTC 2022 Modified Files: pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl Log Message: lintpkgsrc: use proper exit status when showing usage To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1660244135110370 Content-Disposition: inline Content-Length: 1314 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.75 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.76 --- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.75 Thu Aug 11 07:20:52 2022 +++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Thu Aug 11 18:55:35 2022 @@ -1,6 +1,6 @@ #!@PERL5@ -# $NetBSD: lintpkgsrc.pl,v 1.75 2022/08/11 07:20:52 rillig Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.76 2022/08/11 18:55:35 rillig Exp $ # Written by David Brownlee . # @@ -1259,7 +1259,7 @@ sub store_pkgsrc_makefiles($db, $fname) # Remember to update manual page when modifying option list # -sub usage_and_exit() { +sub usage_and_exit($status) { print "Usage: lintpkgsrc [opts] [makefiles] opts: -h : This help. [see lintpkgsrc(1) for more information] @@ -1288,7 +1288,7 @@ Modifiers: -D : Debug makefile and glob parsing -L : List each Makefile when scanned "; - exit; + exit $status; } # Could speed up by building a cache of package names to paths, then processing @@ -1608,7 +1608,7 @@ sub main() { !getopts('BDE:I:K:LM:OP:RSVdg:himopruyz', \%opt) || $opt{h} || !grep(/[BDEORSdgimopruyz]/, keys %opt)) { - usage_and_exit(); + usage_and_exit($opt{h} ? 0 : 1); } $| = 1; --_----------=_1660244135110370--