Date: Fri, 5 Nov 2010 15:56:58 GMT From: Sergey Skvortsov <skv@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: marcus@FreeBSD.org Subject: ports/151966: [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB Message-ID: <201011051556.oA5Fuwsm014450@freefall.freebsd.org> Resent-Message-ID: <201011051600.oA5G0JYx014572@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 151966 >Category: ports >Synopsis: [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Nov 05 16:00:18 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Sergey Skvortsov >Release: FreeBSD 8.1-STABLE-20101015 amd64 >Organization: >Environment: System: FreeBSD protey.ru 8.1-STABLE-20101015 FreeBSD 8.1-STABLE-20101015 #0: Fri Oct 15 03:31:10 UTC 2010 >Description: Added check for the case when LICENSE contains multiple tokens but LICENSE_COMB do not set or equal to 'single' (instead of correct 'multi' or 'dual'). >How-To-Repeat: >Fix: --- portlint-2.13.2.patch begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/ports-mgmt/portlint/Makefile,v retrieving revision 1.138 diff -u -u -r1.138 Makefile --- Makefile 5 Nov 2010 15:44:49 -0000 1.138 +++ Makefile 5 Nov 2010 15:53:25 -0000 @@ -8,8 +8,7 @@ # PORTNAME= portlint -PORTVERSION= 2.13.1 -PORTREVISION= 1 +PORTVERSION= 2.13.2 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none Index: src/portlint.pl =================================================================== RCS file: /home/pcvs/ports/ports-mgmt/portlint/src/portlint.pl,v retrieving revision 1.115 diff -u -u -r1.115 portlint.pl --- src/portlint.pl 28 Oct 2010 21:00:15 -0000 1.115 +++ src/portlint.pl 5 Nov 2010 15:53:25 -0000 @@ -199,7 +199,7 @@ INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER PLIST_FILES OPTIONS INSTALLS_OMF USE_GETTEXT USE_RC_SUBR DIST_SUBDIR ALLFILES IGNOREFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS - GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR + GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB ); my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist); @@ -2399,6 +2399,21 @@ } } + # check value of LICENSE_COMB + if (defined $makevar{LICENSE_COMB} && $makevar{LICENSE_COMB} !~ /^(single|dual|multi$)/) { + &perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'"); + } + + # check LICENSE + if ($makevar{LICENSE} ne '') { + my $comb = $makevar{LICENSE_COMB} // 'single'; + + my @tokens = split(/ /, $makevar{LICENSE}); + if ($comb eq 'single' && scalar(@tokens) > 1) { + &perror("FATAL", $file, -1, "LICENSE contains multiple licenses but LICENSE_COMB is not set to 'dual' or 'multi'"); + } + } + # check the URL if (($tmp =~ /\nMASTER_SITES[+?]?=[ \t]*([^\n]*)\n/ && $1 !~ /^[ \t]*$/) || ($makevar{MASTER_SITES} ne '')) { --- portlint-2.13.2.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?201011051556.oA5Fuwsm014450>