pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Updated pkglint to 5.4.15.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/03f79797f550
branches:  trunk
changeset: 356544:03f79797f550
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Jan 01 16:41:37 2017 +0000

description:
Updated pkglint to 5.4.15.

Changes since 5.4.14:

* Definitions for CONF_FILES should always come in pairs (pkg/37284)

diffstat:

 pkgtools/pkglint/Makefile                   |   4 ++--
 pkgtools/pkglint/files/vardefs.go           |   2 +-
 pkgtools/pkglint/files/vartype.go           |   3 ++-
 pkgtools/pkglint/files/vartypecheck.go      |   7 +++++++
 pkgtools/pkglint/files/vartypecheck_test.go |  12 ++++++++++++
 5 files changed, 24 insertions(+), 4 deletions(-)

diffs (83 lines):

diff -r 847e3b292576 -r 03f79797f550 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Jan 01 16:38:24 2017 +0000
+++ b/pkgtools/pkglint/Makefile Sun Jan 01 16:41:37 2017 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.506 2017/01/01 15:15:47 rillig Exp $
+# $NetBSD: Makefile,v 1.507 2017/01/01 16:41:37 rillig Exp $
 
-PKGNAME=       pkglint-5.4.14
+PKGNAME=       pkglint-5.4.15
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 
diff -r 847e3b292576 -r 03f79797f550 pkgtools/pkglint/files/vardefs.go
--- a/pkgtools/pkglint/files/vardefs.go Sun Jan 01 16:38:24 2017 +0000
+++ b/pkgtools/pkglint/files/vardefs.go Sun Jan 01 16:41:37 2017 +0000
@@ -242,7 +242,7 @@
        acl("CONFIG_SHELL", lkNone, BtPathname, "Makefile, Makefile.common: set")
        acl("CONFIG_SUB_OVERRIDE", lkShell, BtPathmask, "Makefile, Makefile.common: set, append")
        pkglist("CONFLICTS", lkSpace, BtDependency)
-       pkglist("CONF_FILES", lkShell, BtShellWord)
+       pkglist("CONF_FILES", lkNone, BtConfFiles)
        pkg("CONF_FILES_MODE", lkNone, enum("0644 0640 0600 0400"))
        pkglist("CONF_FILES_PERMS", lkShell, BtPerms)
        sys("COPY", lkNone, enum("-c")) // The flag that tells ${INSTALL} to copy a file
diff -r 847e3b292576 -r 03f79797f550 pkgtools/pkglint/files/vartype.go
--- a/pkgtools/pkglint/files/vartype.go Sun Jan 01 16:38:24 2017 +0000
+++ b/pkgtools/pkglint/files/vartype.go Sun Jan 01 16:41:37 2017 +0000
@@ -111,7 +111,7 @@
                return false
        }
        switch vt.basicType {
-       case BtAwkCommand, BtSedCommands, BtShellCommand, BtShellCommands, BtLicense:
+       case BtAwkCommand, BtSedCommands, BtShellCommand, BtShellCommands, BtLicense, BtConfFiles:
                return true
        }
        return false
@@ -213,6 +213,7 @@
        BtCategory               = &BasicType{"Category", (*VartypeCheck).Category}
        BtCFlag                  = &BasicType{"CFlag", (*VartypeCheck).CFlag}
        BtComment                = &BasicType{"Comment", (*VartypeCheck).Comment}
+       BtConfFiles              = &BasicType{"ConfFiles", (*VartypeCheck).ConfFiles}
        BtDependency             = &BasicType{"Dependency", (*VartypeCheck).Dependency}
        BtDependencyWithPath     = &BasicType{"DependencyWithPath", (*VartypeCheck).DependencyWithPath}
        BtDistSuffix             = &BasicType{"DistSuffix", (*VartypeCheck).DistSuffix}
diff -r 847e3b292576 -r 03f79797f550 pkgtools/pkglint/files/vartypecheck.go
--- a/pkgtools/pkglint/files/vartypecheck.go    Sun Jan 01 16:38:24 2017 +0000
+++ b/pkgtools/pkglint/files/vartypecheck.go    Sun Jan 01 16:41:37 2017 +0000
@@ -194,6 +194,13 @@
        }
 }
 
+func (cv *VartypeCheck) ConfFiles() {
+       words, _ := splitIntoMkWords(cv.MkLine.Line, cv.Value)
+       if len(words)%2 != 0 {
+               cv.Line.Warnf("Values for %s should always be pairs of paths.", cv.Varname)
+       }
+}
+
 func (cv *VartypeCheck) Dependency() {
        line, value := cv.Line, cv.Value
 
diff -r 847e3b292576 -r 03f79797f550 pkgtools/pkglint/files/vartypecheck_test.go
--- a/pkgtools/pkglint/files/vartypecheck_test.go       Sun Jan 01 16:38:24 2017 +0000
+++ b/pkgtools/pkglint/files/vartypecheck_test.go       Sun Jan 01 16:41:37 2017 +0000
@@ -82,6 +82,18 @@
                "WARN: fname:6: COMMENT should not be enclosed in quotes.\n")
 }
 
+func (s *Suite) Test_VartypeCheck_ConfFiles(c *check.C) {
+       runVartypeChecks("CONF_FILES", opAssignAppend, (*VartypeCheck).ConfFiles,
+               "single/file",
+               "share/etc/config etc/config",
+               "share/etc/config etc/config file",
+               "share/etc/config etc/config share/etc/config2 etc/config2")
+
+       c.Check(s.Output(), equals, ""+
+               "WARN: fname:1: Values for CONF_FILES should always be pairs of paths.\n"+
+               "WARN: fname:3: Values for CONF_FILES should always be pairs of paths.\n")
+}
+
 func (s *Suite) Test_VartypeCheck_Dependency(c *check.C) {
        runVartypeChecks("CONFLICTS", opAssignAppend, (*VartypeCheck).Dependency,
                "Perl",



Home | Main Index | Thread Index | Old Index