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: Sun May 17 07:07:19 UTC 2020
Modified Files:
pkgsrc/pkgtools/pkglint: Makefile
pkgsrc/pkgtools/pkglint/files: category.go category_test.go pkglint.go
pkglint_test.go
Log Message:
pkgtools/pkglint: update to 20.1.6
Changes since 20.1.5:
Category Makefiles must only list subdirectories in SUBDIR that actually
contain a package. There is no need to mention the other directories.
This is the same as in the top-level Makefile, where mk/ and regress/ are
not listed.
Packages from pkgsrc-wip may have a COMMIT_MSG file with a suggested
commit message for importing the package into main pkgsrc.
To generate a diff of this commit:
cvs rdiff -u -r1.644 -r1.645 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/pkgtools/pkglint/files/category.go \
pkgsrc/pkgtools/pkglint/files/category_test.go
cvs rdiff -u -r1.80 -r1.81 pkgsrc/pkgtools/pkglint/files/pkglint.go
cvs rdiff -u -r1.64 -r1.65 pkgsrc/pkgtools/pkglint/files/pkglint_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.644 pkgsrc/pkgtools/pkglint/Makefile:1.645
--- pkgsrc/pkgtools/pkglint/Makefile:1.644 Sat May 9 19:26:11 2020
+++ pkgsrc/pkgtools/pkglint/Makefile Sun May 17 07:07:18 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.644 2020/05/09 19:26:11 rillig Exp $
+# $NetBSD: Makefile,v 1.645 2020/05/17 07:07:18 rillig Exp $
-PKGNAME= pkglint-20.1.5
+PKGNAME= pkglint-20.1.6
CATEGORIES= pkgtools
DISTNAME= tools
MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/}
Index: pkgsrc/pkgtools/pkglint/files/category.go
diff -u pkgsrc/pkgtools/pkglint/files/category.go:1.32 pkgsrc/pkgtools/pkglint/files/category.go:1.33
--- pkgsrc/pkgtools/pkglint/files/category.go:1.32 Sat Feb 15 13:48:40 2020
+++ pkgsrc/pkgtools/pkglint/files/category.go Sun May 17 07:07:19 2020
@@ -43,9 +43,15 @@ func CheckdirCategory(dir CurrPath) {
// the (hopefully) sorted list of SUBDIRs. The first step is to
// collect the SUBDIRs in the Makefile and in the file system.
- fSubdirs := getSubdirs(dir)
+ var fSubdirs []RelPath
var mSubdirs []subdir
+ for _, subdir := range getSubdirs(dir) {
+ if dir.JoinNoClean(subdir).JoinNoClean("Makefile").IsFile() {
+ fSubdirs = append(fSubdirs, subdir)
+ }
+ }
+
seen := make(map[RelPath]*MkLine)
for !mlex.EOF() {
mkline := mlex.CurrentMkLine()
@@ -114,7 +120,7 @@ func CheckdirCategory(dir CurrPath) {
}
fix := line.Autofix()
- fix.Errorf("%q exists in the file system but not in the Makefile.", fCurrent)
+ fix.Errorf("Package %q must be listed here.", fCurrent)
fix.InsertAbove("SUBDIR+=\t" + fCurrent.String())
fix.Apply()
}
@@ -123,7 +129,7 @@ func CheckdirCategory(dir CurrPath) {
} else if len(fRest) == 0 || mRest[0].name < fRest[0] {
if !fCheck[mRest[0].name] {
fix := mRest[0].line.Autofix()
- fix.Errorf("%q exists in the Makefile but not in the file system.", mRest[0].name)
+ fix.Errorf("%q does not contain a package.", mRest[0].name)
fix.Delete()
fix.Apply()
}
Index: pkgsrc/pkgtools/pkglint/files/category_test.go
diff -u pkgsrc/pkgtools/pkglint/files/category_test.go:1.32 pkgsrc/pkgtools/pkglint/files/category_test.go:1.33
--- pkgsrc/pkgtools/pkglint/files/category_test.go:1.32 Sat Feb 15 13:48:40 2020
+++ pkgsrc/pkgtools/pkglint/files/category_test.go Sun May 17 07:07:19 2020
@@ -29,8 +29,8 @@ func (s *Suite) Test_CheckdirCategory__t
"NOTE: ~/archivers/Makefile:2: Empty line expected above this line.",
"WARN: ~/archivers/Makefile:3: \"aaaaa\" should come before \"pkg1\".",
"ERROR: ~/archivers/Makefile:4: SUBDIR+= line or empty line expected.",
- "ERROR: ~/archivers/Makefile:2: \"pkg1\" exists in the Makefile but not in the file system.",
- "ERROR: ~/archivers/Makefile:3: \"aaaaa\" exists in the Makefile but not in the file system.",
+ "ERROR: ~/archivers/Makefile:2: \"pkg1\" does not contain a package.",
+ "ERROR: ~/archivers/Makefile:3: \"aaaaa\" does not contain a package.",
"NOTE: ~/archivers/Makefile:4: Empty line expected above this line.",
"WARN: ~/archivers/Makefile:4: This line should contain the following text: .include \"../mk/misc/category.mk\"",
"ERROR: ~/archivers/Makefile:4: The file must end here.")
@@ -125,9 +125,9 @@ func (s *Suite) Test_CheckdirCategory__s
"WARN: ~/category/Makefile:7: \"duplicate\" should come before \"in-wrong-order\".",
"WARN: ~/category/Makefile:10: \"commented-mk-and-fs\" should come before \"mk-only\".",
"WARN: ~/category/Makefile:12: \"commented-without-reason\" commented out without giving a reason.",
- "ERROR: ~/category/Makefile:6: \"fs-only\" exists in the file system but not in the Makefile.",
- "ERROR: ~/category/Makefile:9: \"mk-only\" exists in the Makefile but not in the file system.",
- "ERROR: ~/category/Makefile:11: \"commented-mk-only\" exists in the Makefile but not in the file system.")
+ "ERROR: ~/category/Makefile:6: Package \"fs-only\" must be listed here.",
+ "ERROR: ~/category/Makefile:9: \"mk-only\" does not contain a package.",
+ "ERROR: ~/category/Makefile:11: \"commented-mk-only\" does not contain a package.")
}
func (s *Suite) Test_CheckdirCategory__only_in_Makefile(c *check.C) {
@@ -151,10 +151,10 @@ func (s *Suite) Test_CheckdirCategory__o
CheckdirCategory(t.File("category"))
t.CheckOutputLines(
- "ERROR: ~/category/Makefile:5: \"above-only-in-makefile\" exists in the Makefile "+
- "but not in the file system.",
- "ERROR: ~/category/Makefile:7: \"only-in-makefile\" exists in the Makefile "+
- "but not in the file system.")
+ "ERROR: ~/category/Makefile:5: "+
+ "\"above-only-in-makefile\" does not contain a package.",
+ "ERROR: ~/category/Makefile:7: "+
+ "\"only-in-makefile\" does not contain a package.")
}
func (s *Suite) Test_CheckdirCategory__only_in_file_system(c *check.C) {
@@ -178,10 +178,8 @@ func (s *Suite) Test_CheckdirCategory__o
CheckdirCategory(t.File("category"))
t.CheckOutputLines(
- "ERROR: ~/category/Makefile:5: \"above-only-in-fs\" exists in the file system "+
- "but not in the Makefile.",
- "ERROR: ~/category/Makefile:6: \"only-in-fs\" exists in the file system "+
- "but not in the Makefile.")
+ "ERROR: ~/category/Makefile:5: Package \"above-only-in-fs\" must be listed here.",
+ "ERROR: ~/category/Makefile:6: Package \"only-in-fs\" must be listed here.")
}
func (s *Suite) Test_CheckdirCategory__recursive(c *check.C) {
@@ -245,7 +243,7 @@ func (s *Suite) Test_CheckdirCategory__s
CheckdirCategory(t.File("category"))
t.CheckOutputLines(
- "ERROR: ~/category/Makefile:6: \"zzz-fs-only\" exists in the file system but not in the Makefile.",
+ "ERROR: ~/category/Makefile:6: Package \"zzz-fs-only\" must be listed here.",
"AUTOFIX: ~/category/Makefile:6: Inserting a line \"SUBDIR+=\\tzzz-fs-only\" above this line.")
}
@@ -303,7 +301,7 @@ func (s *Suite) Test_CheckdirCategory__c
"ERROR: ~/category/Makefile:3: COMMENT= line expected.",
"NOTE: ~/category/Makefile:3: Empty line expected above this line.",
"ERROR: ~/category/Makefile:3: SUBDIR+= line or empty line expected.",
- "ERROR: ~/category/Makefile:3: \"package\" exists in the file system but not in the Makefile.",
+ "ERROR: ~/category/Makefile:3: Package \"package\" must be listed here.",
"NOTE: ~/category/Makefile:3: Empty line expected above this line.",
"WARN: ~/category/Makefile:3: This line should contain the following text: .include \"../mk/misc/category.mk\"",
"ERROR: ~/category/Makefile:3: The file must end here.")
@@ -364,10 +362,10 @@ func (s *Suite) Test_CheckdirCategory__c
G.Check(t.File("category"))
t.CheckOutputLines(
- "ERROR: ~/category/Makefile:5: \"p5-Net-DNS\" "+
- "exists in the file system but not in the Makefile.",
- "ERROR: ~/category/Makefile:5: \"p5-net-dns\" "+
- "exists in the Makefile but not in the file system.")
+ "ERROR: ~/category/Makefile:5: "+
+ "Package \"p5-Net-DNS\" must be listed here.",
+ "ERROR: ~/category/Makefile:5: "+
+ "\"p5-net-dns\" does not contain a package.")
}
func (s *Suite) Test_CheckdirCategory__dot(c *check.C) {
@@ -389,8 +387,7 @@ func (s *Suite) Test_CheckdirCategory__d
G.Check(".")
t.CheckOutputLines(
- "ERROR: Makefile:5: \"package\" exists in the Makefile " +
- "but not in the file system.")
+ "ERROR: Makefile:5: \"package\" does not contain a package.")
}
func (s *Suite) Test_CheckdirCategory__absolute(c *check.C) {
@@ -416,3 +413,27 @@ func (s *Suite) Test_CheckdirCategory__a
"contains the invalid character \"/\".",
"ERROR: Makefile:5: \"/other\" must be a relative path.")
}
+
+func (s *Suite) Test_CheckdirCategory__subdir_that_is_not_a_package(c *check.C) {
+ t := s.Init(c)
+
+ t.SetUpPkgsrc()
+ t.CreateFileLines("mk/misc/category.mk")
+ t.CreateFileLines("category/Makefile",
+ MkCvsID,
+ "",
+ "COMMENT=\tCategory comment",
+ "",
+ "SUBDIR+=\tsub2",
+ "",
+ ".include \"../mk/misc/category.mk\"")
+ t.CreateFileLines("category/sub1/module.mk")
+ t.CreateFileLines("category/sub2/module.mk")
+ t.Chdir("category")
+ t.FinishSetUp()
+
+ G.Check(".")
+
+ t.CheckOutputLines(
+ "ERROR: Makefile:5: \"sub2\" does not contain a package.")
+}
Index: pkgsrc/pkgtools/pkglint/files/pkglint.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint.go:1.80 pkgsrc/pkgtools/pkglint/files/pkglint.go:1.81
--- pkgsrc/pkgtools/pkglint/files/pkglint.go:1.80 Thu Apr 30 21:15:03 2020
+++ pkgsrc/pkgtools/pkglint/files/pkglint.go Sun May 17 07:07:19 2020
@@ -581,6 +581,9 @@ func (p *Pkglint) checkReg(filename Curr
CheckLinesBuildlink3Mk(mklines)
}
+ case p.Wip && basename == "COMMIT_MSG":
+ // https://mail-index.netbsd.org/pkgsrc-users/2020/05/10/msg031174.html
+
case hasPrefix(basename, "DESCR"):
if lines := Load(filename, NotEmpty|LogErrors); lines != nil {
CheckLinesDescr(lines)
Index: pkgsrc/pkgtools/pkglint/files/pkglint_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.64 pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.65
--- pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.64 Fri May 8 19:50:04 2020
+++ pkgsrc/pkgtools/pkglint/files/pkglint_test.go Sun May 17 07:07:19 2020
@@ -1171,6 +1171,33 @@ func (s *Suite) Test_Pkglint_checkReg__o
t.CheckOutputEmpty()
}
+func (s *Suite) Test_Pkglint_checkReg__main_commit_message(c *check.C) {
+ t := s.Init(c)
+
+ t.SetUpPackage("category/package")
+ t.Chdir("category/package")
+ t.CreateFileLines("COMMIT_MSG")
+ t.FinishSetUp()
+
+ G.Check(".")
+
+ t.CheckOutputLines(
+ "WARN: COMMIT_MSG: Unexpected file found.")
+}
+
+func (s *Suite) Test_Pkglint_checkReg__wip_commit_message(c *check.C) {
+ t := s.Init(c)
+
+ t.SetUpPackage("wip/package")
+ t.Chdir("wip/package")
+ t.CreateFileLines("COMMIT_MSG")
+ t.FinishSetUp()
+
+ G.Check(".")
+
+ t.CheckOutputEmpty()
+}
+
func (s *Suite) Test_Pkglint_checkRegCvsSubst(c *check.C) {
t := s.Init(c)
Home |
Main Index |
Thread Index |
Old Index