Date: Wed, 8 Sep 2004 00:26:52 +0800 (CST) From: Yen-Ming Lee <leeym@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: marcus@FreeBSD.org Subject: ports/71468: [PATCH] devel/portlint: check OPTIONS Message-ID: <20040907162652.DB8523EADDD@utopia.leeym.com> Resent-Message-ID: <200409071630.i87GUVmS031506@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 71468 >Category: ports >Synopsis: [PATCH] devel/portlint: check OPTIONS >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Sep 07 16:30:31 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Yen-Ming Lee >Release: FreeBSD 5.3-BETA3 i386 >Organization: FreeBSD Taiwan >Environment: System: FreeBSD utopia.leeym.com 5.3-BETA3 FreeBSD 5.3-BETA3 #1: Sun Sep 5 01:06:46 CST >Description: - check if all options listed in OPTIONS have related definitions. - check if any WITH_* or WITHOUT_* defined but not listed in OPTIONS. (disabled temporarily, since some ports still use ${SCRIPTDIR}/configure*) Port maintainer (marcus@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.63 >How-To-Repeat: >Fix: --- portlint-2.6.7.patch begins here --- Index: src/portlint.pl =================================================================== RCS file: /home/pcvs/ports/devel/portlint/src/portlint.pl,v retrieving revision 1.63 diff -u -u -r1.63 portlint.pl --- src/portlint.pl 1 Sep 2004 04:13:32 -0000 1.63 +++ src/portlint.pl 7 Sep 2004 14:47:55 -0000 @@ -174,7 +174,7 @@ MASTER_SITES WRKDIR WRKSRC NO_WRKSUBDIR PATCHDIR SCRIPTDIR FILESDIR PKGDIR COMMENT DESCR PLIST PKGCATEGORY PKGINSTALL PKGDEINSTALL PKGREQ PKGMESSAGE MD5_FILE .CURDIR INSTALLS_SHLIB USE_LIBTOOL_VER - INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER + INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER OPTIONS ); my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist); @@ -1020,6 +1020,7 @@ my $use_gnome_hack = 0; my($realwrksrc, $wrksrc, $nowrksubdir) = ('', '', ''); my(@mman, @pman); + my(@mopt, @oopt); my($pkg_version, $versiondir, $versionfile) = ('', '', ''); my $useindex = 0; my %deprecated = (); @@ -2306,6 +2307,25 @@ "use post-patch instead."); } + # check OPTIONS + print "OK: checking OPTIONS.\n" if ($verbose); + @oopt = ($makevar{OPTIONS} =~ /(\w+)\s+\".*?\"\s+\w+/sg); + @mopt = ($tmp =~ /^\s*\.\s*(?:ifdef\s+|if\s+defined\s*)\(?\s*WITH(?:OUT)?_(\w+)\s*\)?/mg); + foreach my $i (@oopt) { + if (!grep(/^$i$/, @mopt)) { + &perror("WARN: $file: $i is listed in OPTIONS, ". + "but neither WITH_$i nor WITHOUT_$i appears."); + } + } + foreach my $i (@mopt) { + next if ($i eq 'NLS'); # skip WITHOUT_NLS + if (!grep(/^$i$/, @oopt)) { + # XXX: disabled temporarily. + # Some ports still use ${SCRIPTDIR}/configure* scripts + #&perror("WARN: $file: WITH_$i or WITHOUT_$i appears, ". + # "consider using OPTIONS macro."); + } + } 1; } --- portlint-2.6.7.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040907162652.DB8523EADDD>