pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/pkglint



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.

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)



Home | Main Index | Thread Index | Old Index