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: Fri Mar 11 00:33:12 UTC 2022
Modified Files:
pkgsrc/pkgtools/pkglint: Makefile
pkgsrc/pkgtools/pkglint/files: package.go package_test.go
Log Message:
pkgtools/pkglint: update to 21.4.3
Changes since 21.4.2:
In simple Makefiles, do not allow the GitHub variables like
GITHUB_RELEASE to occur above DISTNAME anymore. Previously, these
variables had 2 possible places in the "canonical" order.
To generate a diff of this commit:
cvs rdiff -u -r1.711 -r1.712 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.104 -r1.105 pkgsrc/pkgtools/pkglint/files/package.go
cvs rdiff -u -r1.89 -r1.90 pkgsrc/pkgtools/pkglint/files/package_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.711 pkgsrc/pkgtools/pkglint/Makefile:1.712
--- pkgsrc/pkgtools/pkglint/Makefile:1.711 Mon Mar 7 09:14:10 2022
+++ pkgsrc/pkgtools/pkglint/Makefile Fri Mar 11 00:33:12 2022
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.711 2022/03/07 09:14:10 bsiegert Exp $
+# $NetBSD: Makefile,v 1.712 2022/03/11 00:33:12 rillig Exp $
-PKGNAME= pkglint-21.4.2
-PKGREVISION= 2
+PKGNAME= pkglint-21.4.3
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.104 pkgsrc/pkgtools/pkglint/files/package.go:1.105
--- pkgsrc/pkgtools/pkglint/files/package.go:1.104 Sat Nov 13 21:20:59 2021
+++ pkgsrc/pkgtools/pkglint/files/package.go Fri Mar 11 00:33:12 2022
@@ -897,9 +897,6 @@ func (pkg *Package) CheckVarorder(mkline
// See doc/Makefile-example.
// See https://netbsd.org/docs/pkgsrc/pkgsrc.html#components.Makefile.
var variables = []Variable{
- {"GITHUB_PROJECT", optional}, // either here or below MASTER_SITES
- {"GITHUB_TAG", optional},
- {"GITHUB_RELEASE", optional},
{"DISTNAME", optional},
{"PKGNAME", optional},
{"R_PKGNAME", optional},
@@ -907,7 +904,7 @@ func (pkg *Package) CheckVarorder(mkline
{"PKGREVISION", optional},
{"CATEGORIES", once},
{"MASTER_SITES", many},
- {"GITHUB_PROJECT", optional}, // either here or at the very top
+ {"GITHUB_PROJECT", optional},
{"GITHUB_TAG", optional},
{"GITHUB_RELEASE", optional},
{"DIST_SUBDIR", optional},
@@ -915,9 +912,9 @@ func (pkg *Package) CheckVarorder(mkline
{"DISTFILES", many},
{"SITES.*", many},
emptyLine,
- {"PATCH_SITES", optional}, // or once?
+ {"PATCH_SITES", optional},
{"PATCH_SITE_SUBDIR", optional},
- {"PATCHFILES", optional}, // or once?
+ {"PATCHFILES", optional},
{"PATCH_DIST_ARGS", optional},
{"PATCH_DIST_STRIP", optional},
{"PATCH_DIST_CAT", optional},
Index: pkgsrc/pkgtools/pkglint/files/package_test.go
diff -u pkgsrc/pkgtools/pkglint/files/package_test.go:1.89 pkgsrc/pkgtools/pkglint/files/package_test.go:1.90
--- pkgsrc/pkgtools/pkglint/files/package_test.go:1.89 Sat Jan 1 12:44:25 2022
+++ pkgsrc/pkgtools/pkglint/files/package_test.go Fri Mar 11 00:33:12 2022
@@ -2014,9 +2014,12 @@ func (s *Suite) Test_Package_CheckVarord
pkg.CheckVarorder(mklines)
// TODO: Make this warning more specific to the actual situation.
+
+ // Before 2022-03-11, the GitHub variables were allowed above DISTNAME,
+ // which allowed more variation than necessary and made the warning longer.
t.CheckOutputLines(
"WARN: Makefile:3: The canonical order of the variables is " +
- "GITHUB_PROJECT, DISTNAME, CATEGORIES, GITHUB_PROJECT, empty line, " +
+ "DISTNAME, CATEGORIES, GITHUB_PROJECT, empty line, " +
"COMMENT, LICENSE.")
}
@@ -2042,7 +2045,8 @@ func (s *Suite) Test_Package_CheckVarord
}
// Ensure that comments and empty lines do not lead to panics.
-// This would be when accessing fields from the MkLine without checking the line type before.
+// This had been the case when the code accessed fields like Varname from the
+// MkLine without checking the line type before.
func (s *Suite) Test_Package_CheckVarorder__comments_do_not_crash(c *check.C) {
t := s.Init(c)
@@ -2062,7 +2066,7 @@ func (s *Suite) Test_Package_CheckVarord
t.CheckOutputLines(
"WARN: Makefile:3: The canonical order of the variables is " +
- "GITHUB_PROJECT, DISTNAME, CATEGORIES, GITHUB_PROJECT, empty line, " +
+ "DISTNAME, CATEGORIES, GITHUB_PROJECT, empty line, " +
"COMMENT, LICENSE.")
}
@@ -2176,7 +2180,12 @@ func (s *Suite) Test_Package_CheckVarord
pkg.CheckVarorder(mklines)
- t.CheckOutputEmpty()
+ // Before 2022-03-11, the GitHub variables were allowed above DISTNAME,
+ // which allowed more variation than necessary and made the warning longer.
+ t.CheckOutputLines(
+ "WARN: Makefile:3: The canonical order of the variables is " +
+ "DISTNAME, CATEGORIES, MASTER_SITES, GITHUB_PROJECT, " +
+ "GITHUB_TAG, empty line, COMMENT, LICENSE.")
}
func (s *Suite) Test_Package_CheckVarorder__GITHUB_PROJECT_at_the_bottom(c *check.C) {
@@ -2279,7 +2288,7 @@ func (s *Suite) Test_Package_CheckVarord
t.CheckOutputLines(
"WARN: Makefile:3: The canonical order of the variables is " +
- "GITHUB_PROJECT, DISTNAME, PKGNAME, CATEGORIES, " +
+ "DISTNAME, PKGNAME, CATEGORIES, " +
"MASTER_SITES, GITHUB_PROJECT, DIST_SUBDIR, empty line, " +
"MAINTAINER, HOMEPAGE, COMMENT, LICENSE.")
@@ -2287,11 +2296,11 @@ func (s *Suite) Test_Package_CheckVarord
mklines = t.NewMkLines("Makefile",
MkCvsID,
"",
- "GITHUB_PROJECT= pkgbase",
"DISTNAME= v1.0",
"PKGNAME= ${GITHUB_PROJECT}-${DISTNAME}",
"CATEGORIES= net",
"MASTER_SITES= ${MASTER_SITE_GITHUB:=project/}",
+ "GITHUB_PROJECT= pkgbase",
"DIST_SUBDIR= ${GITHUB_PROJECT}",
"",
"MAINTAINER= maintainer%example.org@localhost",
Home |
Main Index |
Thread Index |
Old Index