diff options
author | rillig <rillig@pkgsrc.org> | 2019-05-22 16:07:16 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2019-05-22 16:07:16 +0000 |
commit | 65da735bb642841ffc343e67e3a03960f1e42a7a (patch) | |
tree | 01945d79fb6efcc434065afcdd1b4e1024c79299 /pkgtools | |
parent | dae4ded55d08e4ab69918d4f5be3b56338b19cce (diff) | |
download | pkgsrc-65da735bb642841ffc343e67e3a03960f1e42a7a.tar.gz |
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.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/package.go | 6 | ||||
-rw-r--r-- | pkgtools/pkglint/files/tools.go | 37 | ||||
-rw-r--r-- | pkgtools/pkglint/files/tools_test.go | 18 |
4 files changed, 50 insertions, 15 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 14d998b607c..55fee78bf45 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -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/} diff --git a/pkgtools/pkglint/files/package.go b/pkgtools/pkglint/files/package.go index c12421f1b8e..c63a06fd4d3 100644 --- a/pkgtools/pkglint/files/package.go +++ b/pkgtools/pkglint/files/package.go @@ -293,8 +293,8 @@ func (pkg *Package) loadPackageMakefile() (MkLines, MkLines) { // 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) checkfilePackageMakefile(filename string, mklines MkLines, a } 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) diff --git a/pkgtools/pkglint/files/tools.go b/pkgtools/pkglint/files/tools.go index 8756675f19b..a0d52295485 100644 --- a/pkgtools/pkglint/files/tools.go +++ b/pkgtools/pkglint/files/tools.go @@ -302,25 +302,40 @@ func (tr *Tools) parseUseTools(mkline MkLine, createIfAbsent bool, addToUseTools 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 diff --git a/pkgtools/pkglint/files/tools_test.go b/pkgtools/pkglint/files/tools_test.go index 3d7722c9464..ce48f2f89b5 100644 --- a/pkgtools/pkglint/files/tools_test.go +++ b/pkgtools/pkglint/files/tools_test.go @@ -606,3 +606,21 @@ func (s *Suite) Test_Tools__gmake(c *check.C) { 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() +} |