summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2018-04-06 21:04:22 +0000
committerrillig <rillig@pkgsrc.org>2018-04-06 21:04:22 +0000
commitb67c5bb6f2b64674310efdae51ec16a8e666787e (patch)
tree823bcd4d6bd876b6975866a9fee5d4a1648de4f0 /pkgtools
parent075702086d7d829714ff86122fb8cc324dbb11c0 (diff)
downloadpkgsrc-b67c5bb6f2b64674310efdae51ec16a8e666787e.tar.gz
pkgtools/pkglint: update to 5.5.8
Changes since 5.5.7: * Enable the check for variable order in Makefiles by default.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile5
-rw-r--r--pkgtools/pkglint/files/package.go3
-rw-r--r--pkgtools/pkglint/files/package_test.go4
-rw-r--r--pkgtools/pkglint/files/pkglint.go2
-rw-r--r--pkgtools/pkglint/files/pkglint_test.go2
5 files changed, 10 insertions, 6 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 16f7c43ce94..49d8612fbf4 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.534 2018/03/30 11:56:25 bsiegert Exp $
+# $NetBSD: Makefile,v 1.535 2018/04/06 21:04:22 rillig Exp $
-PKGNAME= pkglint-5.5.7
-PKGREVISION= 1
+PKGNAME= pkglint-5.5.8
DISTFILES= # none
CATEGORIES= pkgtools
diff --git a/pkgtools/pkglint/files/package.go b/pkgtools/pkglint/files/package.go
index 14320ab2528..d2c7eb5a02d 100644
--- a/pkgtools/pkglint/files/package.go
+++ b/pkgtools/pkglint/files/package.go
@@ -708,6 +708,9 @@ func (pkg *Package) CheckVarorder(mklines *MkLines) {
}
}
+ if firstRelevant == -1 {
+ return true
+ }
interesting := mklines.mklines[firstRelevant : lastRelevant+1]
varcanon := func() string {
diff --git a/pkgtools/pkglint/files/package_test.go b/pkgtools/pkglint/files/package_test.go
index 9f9bd4e3356..aeae8bc13e7 100644
--- a/pkgtools/pkglint/files/package_test.go
+++ b/pkgtools/pkglint/files/package_test.go
@@ -397,7 +397,8 @@ func (s *Suite) Test_Package__varuse_at_load_time(c *check.C) {
"WARN: ~/category/pkgbase/Makefile:8: To use the tool \"FALSE\" at load time, bsd.prefs.mk has to be included before.",
"WARN: ~/category/pkgbase/Makefile:9: To use the tool \"NICE\" at load time, bsd.prefs.mk has to be included before.",
"WARN: ~/category/pkgbase/Makefile:10: To use the tool \"TRUE\" at load time, bsd.prefs.mk has to be included before.",
- "WARN: ~/category/pkgbase/Makefile:16: To use the tool \"NICE\" at load time, it has to be added to USE_TOOLS before including bsd.prefs.mk.")
+ "WARN: ~/category/pkgbase/Makefile:16: To use the tool \"NICE\" at load time, it has to be added to USE_TOOLS before including bsd.prefs.mk.",
+ "WARN: ~/category/pkgbase/Makefile:3: The canonical order of the variables is CATEGORIES, empty line, COMMENT, LICENSE.")
}
func (s *Suite) Test_Package_loadPackageMakefile(c *check.C) {
@@ -461,6 +462,7 @@ func (s *Suite) Test_Package_conditionalAndUnconditionalInclude(c *check.C) {
G.checkdirPackage("category/package")
t.CheckOutputLines(
+ "WARN: ~/category/package/Makefile:3: The canonical order of the variables is CATEGORIES, empty line, COMMENT, LICENSE.",
"WARN: ~/category/package/options.mk:3: Unknown option \"zlib\".",
"WARN: ~/category/package/options.mk:4: \"../../devel/zlib/buildlink3.mk\" is "+
"included conditionally here (depending on PKG_OPTIONS) and unconditionally in Makefile:5.",
diff --git a/pkgtools/pkglint/files/pkglint.go b/pkgtools/pkglint/files/pkglint.go
index 18c7f6db461..7fb0f2d1ae0 100644
--- a/pkgtools/pkglint/files/pkglint.go
+++ b/pkgtools/pkglint/files/pkglint.go
@@ -229,7 +229,7 @@ func (pkglint *Pkglint) ParseCommandLine(args []string) *int {
warn.AddFlagVar("absname", &gopts.WarnAbsname, true, "warn about use of absolute file names")
warn.AddFlagVar("directcmd", &gopts.WarnDirectcmd, true, "warn about use of direct command names instead of Make variables")
warn.AddFlagVar("extra", &gopts.WarnExtra, false, "enable some extra warnings")
- warn.AddFlagVar("order", &gopts.WarnOrder, false, "warn if Makefile entries are unordered")
+ warn.AddFlagVar("order", &gopts.WarnOrder, true, "warn if Makefile entries are unordered")
warn.AddFlagVar("perm", &gopts.WarnPerm, false, "warn about unforeseen variable definition and use")
warn.AddFlagVar("plist-depr", &gopts.WarnPlistDepr, false, "warn about deprecated paths in PLISTs")
warn.AddFlagVar("plist-sort", &gopts.WarnPlistSort, false, "warn about unsorted entries in PLISTs")
diff --git a/pkgtools/pkglint/files/pkglint_test.go b/pkgtools/pkglint/files/pkglint_test.go
index 8bc45807d5b..ada17e57259 100644
--- a/pkgtools/pkglint/files/pkglint_test.go
+++ b/pkgtools/pkglint/files/pkglint_test.go
@@ -101,7 +101,7 @@ func (s *Suite) Test_Pkglint_Main__unknown_option(c *check.C) {
" absname warn about use of absolute file names (enabled)",
" directcmd warn about use of direct command names instead of Make variables (enabled)",
" extra enable some extra warnings (disabled)",
- " order warn if Makefile entries are unordered (disabled)",
+ " order warn if Makefile entries are unordered (enabled)",
" perm warn about unforeseen variable definition and use (disabled)",
" plist-depr warn about deprecated paths in PLISTs (disabled)",
" plist-sort warn about unsorted entries in PLISTs (disabled)",