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:           Wed May 22 16:07:16 UTC 2019

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: package.go tools.go tools_test.go

Log Message:
pkgtools/pkglint: update to 5.7.11

Changes since 5.7.10:

Fixed wrong warnings about autoconf being an unknown shell command when
an included file had defined USE_TOOLS+=autoconf213.


To generate a diff of this commit:
cvs rdiff -u -r1.580 -r1.581 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.54 -r1.55 pkgsrc/pkgtools/pkglint/files/package.go
cvs rdiff -u -r1.13 -r1.14 pkgsrc/pkgtools/pkglint/files/tools.go
cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/pkglint/files/tools_test.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.580 pkgsrc/pkgtools/pkglint/Makefile:1.581
--- pkgsrc/pkgtools/pkglint/Makefile:1.580      Tue May 21 17:59:48 2019
+++ pkgsrc/pkgtools/pkglint/Makefile    Wed May 22 16:07:16 2019
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.580 2019/05/21 17:59:48 rillig Exp $
+# $NetBSD: Makefile,v 1.581 2019/05/22 16:07:16 rillig Exp $
 
-PKGNAME=       pkglint-5.7.10
+PKGNAME=       pkglint-5.7.11
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/package.go
diff -u pkgsrc/pkgtools/pkglint/files/package.go:1.54 pkgsrc/pkgtools/pkglint/files/package.go:1.55
--- pkgsrc/pkgtools/pkglint/files/package.go:1.54       Tue May 21 17:59:48 2019
+++ pkgsrc/pkgtools/pkglint/files/package.go    Wed May 22 16:07:16 2019
@@ -293,8 +293,8 @@ func (pkg *Package) loadPackageMakefile(
 
        // See mk/tools/cmake.mk
        if pkg.vars.Defined("USE_CMAKE") {
-               mainLines.Tools.def("cmake", "", false, AtRunTime, nil)
-               mainLines.Tools.def("cpack", "", false, AtRunTime, nil)
+               allLines.Tools.def("cmake", "", false, AtRunTime, nil)
+               allLines.Tools.def("cpack", "", false, AtRunTime, nil)
        }
 
        allLines.collectUsedVariables()
@@ -600,6 +600,8 @@ func (pkg *Package) checkfilePackageMake
        }
 
        pkg.checkUpdate()
+       allLines.collectDefinedVariables() // To get the tool definitions
+       mklines.Tools = allLines.Tools     // TODO: also copy the other collected data
        mklines.Check()
        pkg.CheckVarorder(mklines)
        SaveAutofixChanges(mklines.lines)

Index: pkgsrc/pkgtools/pkglint/files/tools.go
diff -u pkgsrc/pkgtools/pkglint/files/tools.go:1.13 pkgsrc/pkgtools/pkglint/files/tools.go:1.14
--- pkgsrc/pkgtools/pkglint/files/tools.go:1.13 Tue Apr 23 21:20:49 2019
+++ pkgsrc/pkgtools/pkglint/files/tools.go      Wed May 22 16:07:16 2019
@@ -302,25 +302,40 @@ func (tr *Tools) parseUseTools(mkline Mk
                return
        }
 
-       deps := mkline.ValueFields(value)
-
-       // See mk/tools/autoconf.mk:/^\.if !defined/
-       if matches(value, `\bautoconf213\b`) {
-               deps = append(deps, "autoconf-2.13", "autoheader-2.13", "autoreconf-2.13", "autoscan-2.13", "autoupdate-2.13", "ifnames-2.13")
-       }
-       if matches(value, `\bautoconf\b`) {
-               deps = append(deps, "autoheader", "autom4te", "autoreconf", "autoscan", "autoupdate", "ifnames")
-       }
-
        validity := tr.validity(mkline.Basename, addToUseTools)
-       for _, dep := range deps {
+       for _, dep := range mkline.ValueFields(value) {
                name := strings.Split(dep, ":")[0]
                if createIfAbsent || tr.ByName(name) != nil {
                        tr.def(name, "", false, validity, nil)
+                       for _, implicitName := range tr.implicitTools(name) {
+                               tr.def(implicitName, "", false, validity, nil)
+                       }
                }
        }
 }
 
+func (tr *Tools) implicitTools(toolName string) []string {
+
+       // See mk/tools/autoconf.mk:/^\.if !defined/
+
+       if toolName == "autoconf213" {
+               return []string{
+                       "autoconf-2.13", "autoheader-2.13", "autoreconf-2.13",
+                       "autoscan-2.13", "autoupdate-2.13", "ifnames-2.13",
+                       "autoconf",
+                       "autoheader", "autom4te", "autoreconf",
+                       "autoscan", "autoupdate", "ifnames"}
+       }
+
+       if toolName == "autoconf" {
+               return []string{
+                       "autoheader", "autom4te", "autoreconf",
+                       "autoscan", "autoupdate", "ifnames"}
+       }
+
+       return nil
+}
+
 func (tr *Tools) validity(basename string, useTools bool) Validity {
        switch {
        case IsPrefs(basename): // IsPrefs is not 100% accurate here but good enough

Index: pkgsrc/pkgtools/pkglint/files/tools_test.go
diff -u pkgsrc/pkgtools/pkglint/files/tools_test.go:1.15 pkgsrc/pkgtools/pkglint/files/tools_test.go:1.16
--- pkgsrc/pkgtools/pkglint/files/tools_test.go:1.15    Tue Apr 23 21:20:49 2019
+++ pkgsrc/pkgtools/pkglint/files/tools_test.go Wed May 22 16:07:16 2019
@@ -606,3 +606,21 @@ func (s *Suite) Test_Tools__gmake(c *che
 
        t.CheckOutputEmpty()
 }
+
+func (s *Suite) Test_Tools__autoconf213(c *check.C) {
+       t := s.Init(c)
+
+       t.SetUpPackage("category/package",
+               "USE_TOOLS=\tautoconf213",
+               "",
+               "do-test:",
+               "\tautoconf")
+       t.CreateFileLines("mk/tools/defaults.mk",
+               "_TOOLS_DEPMETHOD.autoconf213=\tDEPENDS")
+       t.FinishSetUp()
+
+       G.Check(t.File("category/package"))
+
+       // No warning, since autoconf213 defines autoconf implicitly.
+       t.CheckOutputEmpty()
+}



Home | Main Index | Thread Index | Old Index