Received: by mail.netbsd.org (Postfix, from userid 605) id 75055850C5; Mon, 14 May 2018 20:25:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 005CE850C0 for ; Mon, 14 May 2018 20:25:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id vOitngImHc_W for ; Mon, 14 May 2018 20:25:49 +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 35CE0850BE for ; Mon, 14 May 2018 20:25:49 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 2B6CCFBEC; Mon, 14 May 2018 20:25:49 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_152632954921880" MIME-Version: 1.0 Date: Mon, 14 May 2018 20:25:49 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/pkglint To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20180514202549.2B6CCFBEC@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_152632954921880 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Mon May 14 20:25:49 UTC 2018 Modified Files: pkgsrc/pkgtools/pkglint: Makefile pkgsrc/pkgtools/pkglint/files: util.go vardefs.go Log Message: Update pkglint to 5.5.11 Changes since 5.5.10: * Read JVMs and compiler languages from mk/* instead of predefined lists. * Support TEST_DEPENDS. To generate a diff of this commit: cvs rdiff -u -r1.537 -r1.538 pkgsrc/pkgtools/pkglint/Makefile cvs rdiff -u -r1.22 -r1.23 pkgsrc/pkgtools/pkglint/files/util.go cvs rdiff -u -r1.40 -r1.41 pkgsrc/pkgtools/pkglint/files/vardefs.go Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_152632954921880 Content-Disposition: inline Content-Length: 4511 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/pkglint/Makefile diff -u pkgsrc/pkgtools/pkglint/Makefile:1.537 pkgsrc/pkgtools/pkglint/Makefile:1.538 --- pkgsrc/pkgtools/pkglint/Makefile:1.537 Tue May 1 23:30:11 2018 +++ pkgsrc/pkgtools/pkglint/Makefile Mon May 14 20:25:48 2018 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.537 2018/05/01 23:30:11 rillig Exp $ +# $NetBSD: Makefile,v 1.538 2018/05/14 20:25:48 rillig Exp $ -PKGNAME= pkglint-5.5.10 +PKGNAME= pkglint-5.5.11 DISTFILES= # none CATEGORIES= pkgtools Index: pkgsrc/pkgtools/pkglint/files/util.go diff -u pkgsrc/pkgtools/pkglint/files/util.go:1.22 pkgsrc/pkgtools/pkglint/files/util.go:1.23 --- pkgsrc/pkgtools/pkglint/files/util.go:1.22 Sat Apr 28 23:32:52 2018 +++ pkgsrc/pkgtools/pkglint/files/util.go Mon May 14 20:25:48 2018 @@ -9,6 +9,7 @@ import ( "path" "path/filepath" "regexp" + "sort" "strconv" "strings" "time" @@ -47,6 +48,15 @@ func ifelseStr(cond bool, a, b string) s return b } +func keysJoined(m map[string]bool) string { + var keys []string + for key := range m { + keys = append(keys, key) + } + sort.Strings(keys) + return strings.Join(keys, " ") +} + func imax(a, b int) int { if a > b { return a Index: pkgsrc/pkgtools/pkglint/files/vardefs.go diff -u pkgsrc/pkgtools/pkglint/files/vardefs.go:1.40 pkgsrc/pkgtools/pkglint/files/vardefs.go:1.41 --- pkgsrc/pkgtools/pkglint/files/vardefs.go:1.40 Tue May 1 23:30:11 2018 +++ pkgsrc/pkgtools/pkglint/files/vardefs.go Mon May 14 20:25:48 2018 @@ -2,6 +2,7 @@ package main import ( "fmt" + "netbsd.org/pkglint/trace" "path" "strings" ) @@ -70,7 +71,55 @@ func (src *Pkgsrc) InitVartypes() { acl(varname, kindOfList, checker, "buildlink3.mk, builtin.mk:; *: use-loadtime, use") } - jvms := enum("openjdk8 oracle-jdk8 openjdk7 sun-jdk7 sun-jdk6 jdk16 jdk15 kaffe") // See mk/java-vm.mk:/_PKG_JVMS/ + jvms := enum(func() string { + lines, _ := readLines(src.File("mk/java-vm.mk"), true) + mklines := NewMkLines(lines) + jvms := make(map[string]bool) + for _, mkline := range mklines.mklines { + if mkline.IsVarassign() && mkline.Varcanon() == "_PKG_JVMS.*" { + words, _ := splitIntoMkWords(mkline.Line, mkline.Value()) + for _, word := range words { + if !contains(word, "$") { + jvms[word] = true + } + } + } + } + if len(jvms) == 0 { + return "openjdk8 oracle-jdk8 openjdk7 sun-jdk7 sun-jdk6 jdk16 jdk15 kaffe" + } + joined := keysJoined(jvms) + if trace.Tracing { + trace.Stepf("JVMs from mk/java-vm.mk: %s", joined) + } + return joined + }()) + + languages := enum( + func() string { + lines, _ := readLines(src.File("mk/compiler.mk"), true) + mklines := NewMkLines(lines) + languages := make(map[string]bool) + for _, mkline := range mklines.mklines { + if mkline.IsCond() && mkline.Directive() == "for" { + words := splitOnSpace(mkline.Args()) + if len(words) > 2 && words[0] == "_version_" { + for _, word := range words[2:] { + languages[word] = true + } + } + } + } + for _, language := range splitOnSpace("ada c c99 c++ c++11 fortran fortran77 java objc obj-c++") { + languages[language] = true + } + + joined := keysJoined(languages) + if trace.Tracing { + trace.Stepf("Languages from mk/compiler.mk: %s", joined) + } + return joined + }()) // Last synced with mk/defaults/mk.conf revision 1.269 usr("USE_CWRAPPERS", lkNone, enum("yes no auto")) @@ -949,6 +998,7 @@ func (src *Pkgsrc) InitVartypes() { pkg("SUBST_STAGE.*", lkNone, BtStage) pkglist("SUBST_VARS.*", lkShell, BtVariableName) pkglist("SUPERSEDES", lkSpace, BtDependency) + acl("TEST_DEPENDS", lkSpace, BtDependencyWithPath, "Makefile, Makefile.common, *.mk: append") pkglist("TEST_DIRS", lkShell, BtWrksrcSubdirectory) pkglist("TEST_ENV", lkShell, BtShellWord) acl("TEST_TARGET", lkShell, BtIdentifier, "Makefile: set; Makefile.common: default, set; options.mk: set, append") @@ -983,7 +1033,7 @@ func (src *Pkgsrc) InitVartypes() { acl("USE_IMAKE", lkNone, BtYes, "Makefile: set") pkg("USE_JAVA", lkNone, enum("run yes build")) pkg("USE_JAVA2", lkNone, enum("YES yes no 1.4 1.5 6 7 8")) - acl("USE_LANGUAGES", lkShell, enum("ada c c99 c++ c++11 fortran fortran77 java objc"), "Makefile, Makefile.common, options.mk: set, append") + acl("USE_LANGUAGES", lkShell, languages, "Makefile, Makefile.common, options.mk: set, append") pkg("USE_LIBTOOL", lkNone, BtYes) pkg("USE_MAKEINFO", lkNone, BtYes) pkg("USE_MSGFMT_PLURALS", lkNone, BtYes) --_----------=_152632954921880--