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 Aug 16 21:00:17 UTC 2019

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: options.go pkgsrc.go vardefs.go
            vardefs_test.go

Log Message:
pkgtools/pkglint: update to 5.7.20

Changes since 5.7.19:

* Fixed warning about unknown C++ standard versions, which had appeared
  after the code in mk/compiler.mk changed.


To generate a diff of this commit:
cvs rdiff -u -r1.592 -r1.593 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/pkglint/files/options.go
cvs rdiff -u -r1.33 -r1.34 pkgsrc/pkgtools/pkglint/files/pkgsrc.go
cvs rdiff -u -r1.68 -r1.69 pkgsrc/pkgtools/pkglint/files/vardefs.go
cvs rdiff -u -r1.18 -r1.19 pkgsrc/pkgtools/pkglint/files/vardefs_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.592 pkgsrc/pkgtools/pkglint/Makefile:1.593
--- pkgsrc/pkgtools/pkglint/Makefile:1.592      Wed Aug 14 15:45:46 2019
+++ pkgsrc/pkgtools/pkglint/Makefile    Fri Aug 16 21:00:17 2019
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.592 2019/08/14 15:45:46 bsiegert Exp $
+# $NetBSD: Makefile,v 1.593 2019/08/16 21:00:17 rillig Exp $
 
-PKGNAME=       pkglint-5.7.19
-PKGREVISION=   1
+PKGNAME=       pkglint-5.7.20
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/options.go
diff -u pkgsrc/pkgtools/pkglint/files/options.go:1.15 pkgsrc/pkgtools/pkglint/files/options.go:1.16
--- pkgsrc/pkgtools/pkglint/files/options.go:1.15       Sun Jun 30 20:56:19 2019
+++ pkgsrc/pkgtools/pkglint/files/options.go    Fri Aug 16 21:00:17 2019
@@ -68,7 +68,7 @@ func (ck *OptionsLinesChecker) lookingAt
        return false
 }
 
-// checkLineUpper checks a line from the upper part of an options.mk file,
+// handleUpperLine checks a line from the upper part of an options.mk file,
 // before bsd.options.mk is included.
 func (ck *OptionsLinesChecker) handleUpperLine(mkline *MkLine) bool {
        switch {
@@ -153,7 +153,7 @@ func (ck *OptionsLinesChecker) handleLow
                        "and write the condition like this, which has the same effect",
                        "as the !empty(...).",
                        "",
-                       "\t.if ${PKG_OPTIONS.packagename:Moption}")
+                       "\t.if ${PKG_OPTIONS:Moption}")
        }
 }
 

Index: pkgsrc/pkgtools/pkglint/files/pkgsrc.go
diff -u pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.33 pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.34
--- pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.33        Tue Jul 30 18:31:43 2019
+++ pkgsrc/pkgtools/pkglint/files/pkgsrc.go     Fri Aug 16 21:00:17 2019
@@ -202,13 +202,6 @@ func (src *Pkgsrc) ListVersions(category
        }
 
        categoryDir := src.File(category)
-       error := func() []string {
-               if errorIfEmpty {
-                       dummyLine.Errorf("Cannot find package versions of %q in %q.", re, categoryDir)
-               }
-               src.listVersions[cacheKey] = nil
-               return nil
-       }
 
        var names []string
        for _, fileInfo := range src.ReadDir(category) {
@@ -218,7 +211,11 @@ func (src *Pkgsrc) ListVersions(category
                }
        }
        if len(names) == 0 {
-               return error()
+               if errorIfEmpty {
+                       dummyLine.Errorf("Cannot find package versions of %q in %q.", re, categoryDir)
+               }
+               src.listVersions[cacheKey] = nil
+               return nil
        }
 
        // In the pkgsrc directories, the major versions of packages are

Index: pkgsrc/pkgtools/pkglint/files/vardefs.go
diff -u pkgsrc/pkgtools/pkglint/files/vardefs.go:1.68 pkgsrc/pkgtools/pkglint/files/vardefs.go:1.69
--- pkgsrc/pkgtools/pkglint/files/vardefs.go:1.68       Sun Jun 30 20:56:19 2019
+++ pkgsrc/pkgtools/pkglint/files/vardefs.go    Fri Aug 16 21:00:17 2019
@@ -315,19 +315,19 @@ func (reg *VarTypeRegistry) compilerLang
        languages := make(map[string]bool)
        if mklines != nil {
                for _, mkline := range mklines.mklines {
-                       if mkline.IsDirective() && mkline.Directive() == "for" {
-                               words := mkline.ValueFields(mkline.Args())
-                               if len(words) > 2 && words[0] == "_version_" {
-                                       for _, word := range words[2:] {
-                                               languages[intern(word)] = true
-                                       }
+                       if mkline.IsVarassign() && mkline.Varname() == "_CXX_STD_VERSIONS" {
+                               words := mkline.ValueFields(mkline.Value())
+                               for _, word := range words {
+                                       languages[intern(word)] = true
                                }
                        }
                }
        }
+
        alwaysAvailable := [...]string{
                "ada", "c", "c99", "c++", "c++11", "c++14",
                "fortran", "fortran77", "java", "objc", "obj-c++"}
+
        for _, language := range alwaysAvailable {
                languages[language] = true
        }

Index: pkgsrc/pkgtools/pkglint/files/vardefs_test.go
diff -u pkgsrc/pkgtools/pkglint/files/vardefs_test.go:1.18 pkgsrc/pkgtools/pkglint/files/vardefs_test.go:1.19
--- pkgsrc/pkgtools/pkglint/files/vardefs_test.go:1.18  Sun Jul 14 21:25:47 2019
+++ pkgsrc/pkgtools/pkglint/files/vardefs_test.go       Fri Aug 16 21:00:17 2019
@@ -33,16 +33,11 @@ func (s *Suite) Test_VarTypeRegistry_enu
                "                        sunpro",
                "_PSEUDO_COMPILERS=      ccache distcc f2c g95",
                "",
-               ".for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03",
+               "_CXX_STD_VERSIONS=      gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03",
+               ".for _version_ in ${_CXX_STD_VERSIONS}",
                ".  if !empty(USE_LANGUAGES:M${_version_})",
                "USE_LANGUAGES+=         c++",
                ".  endif",
-               ".endfor",
-               "",
-               ".for _version_", // Just for code coverage.
-               ".endfor",
-               "",
-               ".for version in c99 c200x", // Just for code coverage.
                ".endfor")
 
        t.SetUpVartypes()



Home | Main Index | Thread Index | Old Index