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:           Sat Jul  9 13:16:43 UTC 2016

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: buildlink3.go buildlink3_test.go
            mkline_test.go plist.go plist_test.go

Log Message:
Updated pkglint to 5.4.5.

Changes since 5.4.4:

* Removed autofix for variables in BUILDLINK_TREE, since that change
  affects multiple variables in the file and therefore cannot be done
  automatically
* Fixed PLIST sorting to not lose lines


To generate a diff of this commit:
cvs rdiff -u -r1.489 -r1.490 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkglint/files/buildlink3.go \
    pkgsrc/pkgtools/pkglint/files/buildlink3_test.go
cvs rdiff -u -r1.14 -r1.15 pkgsrc/pkgtools/pkglint/files/mkline_test.go
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/pkglint/files/plist.go
cvs rdiff -u -r1.7 -r1.8 pkgsrc/pkgtools/pkglint/files/plist_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.489 pkgsrc/pkgtools/pkglint/Makefile:1.490
--- pkgsrc/pkgtools/pkglint/Makefile:1.489      Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/Makefile    Sat Jul  9 13:16:43 2016
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.489 2016/07/09 09:43:48 rillig Exp $
+# $NetBSD: Makefile,v 1.490 2016/07/09 13:16:43 rillig Exp $
 
-PKGNAME=       pkglint-5.4.4
+PKGNAME=       pkglint-5.4.5
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 

Index: pkgsrc/pkgtools/pkglint/files/buildlink3.go
diff -u pkgsrc/pkgtools/pkglint/files/buildlink3.go:1.5 pkgsrc/pkgtools/pkglint/files/buildlink3.go:1.6
--- pkgsrc/pkgtools/pkglint/files/buildlink3.go:1.5     Sun Jun  5 11:24:32 2016
+++ pkgsrc/pkgtools/pkglint/files/buildlink3.go Sat Jul  9 13:16:43 2016
@@ -47,14 +47,14 @@ func ChecklinesBuildlink3Mk(mklines *MkL
                        {"${RUBY_PKGPREFIX}", "ruby"},
                        {"${PHP_PKG_PREFIX}", "php"},
                } {
-                       if contains(pkgbase, pair.varuse) && !pkgbaseLine.AutofixReplace(pair.varuse, pair.simple) {
-                               pkgbaseLine.Warn2("Please use %q instead of %q.", pair.simple, pair.varuse)
+                       if contains(pkgbase, pair.varuse) {
+                               pkgbaseLine.Warn2("Please use %q instead of %q (also in other variables in this file).", pair.simple, pair.varuse)
                                warned = true
                        }
                }
                if !warned {
                        if m, varuse := match1(pkgbase, `(\$\{\w+\})`); m {
-                               pkgbaseLine.Warn1("Please replace %q with a simple string.", varuse)
+                               pkgbaseLine.Warn1("Please replace %q with a simple string (also in other variables in this file).", varuse)
                                warned = true
                        }
                }
Index: pkgsrc/pkgtools/pkglint/files/buildlink3_test.go
diff -u pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.5 pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.6
--- pkgsrc/pkgtools/pkglint/files/buildlink3_test.go:1.5        Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/buildlink3_test.go    Sat Jul  9 13:16:43 2016
@@ -252,7 +252,7 @@ func (s *Suite) Test_ChecklinesBuildlink
 
        ChecklinesBuildlink3Mk(mklines)
 
-       c.Check(s.Output(), equals, "WARN: buildlink3.mk:3: Please use \"py\" instead of \"${PYPKGPREFIX}\".\n")
+       c.Check(s.Output(), equals, "WARN: buildlink3.mk:3: Please use \"py\" instead of \"${PYPKGPREFIX}\" (also in other variables in this file).\n")
 }
 
 func (s *Suite) Test_ChecklinesBuildlink3Mk_PKGBASE_with_unknown_variable(c *check.C) {
@@ -275,6 +275,6 @@ func (s *Suite) Test_ChecklinesBuildlink
        ChecklinesBuildlink3Mk(mklines)
 
        c.Check(s.Output(), equals, ""+
-               "WARN: buildlink3.mk:3: Please replace \"${LICENSE}\" with a simple string.\n"+
+               "WARN: buildlink3.mk:3: Please replace \"${LICENSE}\" with a simple string (also in other variables in this file).\n"+
                "WARN: buildlink3.mk:13: This line should contain the following text: BUILDLINK_TREE+=\t-${LICENSE}-wxWidgets\n")
 }

Index: pkgsrc/pkgtools/pkglint/files/mkline_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.14 pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.15
--- pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.14   Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/mkline_test.go        Sat Jul  9 13:16:43 2016
@@ -234,7 +234,7 @@ func (s *Suite) Test_NewMkLine__autofix_
                "AUTOFIX: ~/Makefile: Has been auto-fixed. Please re-run pkglint.\n"+
                "AUTOFIX: ~/Makefile: Has been auto-fixed. Please re-run pkglint.\n")
        c.Check(s.LoadTmpFile(c, "Makefile"), equals, ""+
-               "# $NetBSD: mkline_test.go,v 1.14 2016/07/09 09:43:48 rillig Exp $\n"+
+               mkrcsid+"\n"+
                "VARNAME+=\t${VARNAME}\n"+
                "VARNAME+ =\t${VARNAME+}\n"+
                "VARNAME++=\t${VARNAME+}\n"+

Index: pkgsrc/pkgtools/pkglint/files/plist.go
diff -u pkgsrc/pkgtools/pkglint/files/plist.go:1.6 pkgsrc/pkgtools/pkglint/files/plist.go:1.7
--- pkgsrc/pkgtools/pkglint/files/plist.go:1.6  Thu Jul  7 12:09:27 2016
+++ pkgsrc/pkgtools/pkglint/files/plist.go      Sat Jul  9 13:16:43 2016
@@ -61,8 +61,8 @@ func (ck *PlistChecker) Check(plainLines
                ck.checkline(pline)
                pline.CheckTrailingWhitespace()
        }
-
        ChecklinesTrailingEmptyLines(plainLines)
+
        if G.opts.WarnPlistSort {
                sorter := NewPlistLineSorter(plines)
                sorter.Sort()
@@ -469,8 +469,8 @@ func NewPlistLineSorter(plines []*PlistL
                } else {
                        s.plines = append(s.plines, pline)
                        s.lines = append(s.lines, pline.line)
+                       prev = pline
                }
-               prev = pline
        }
        return s
 }

Index: pkgsrc/pkgtools/pkglint/files/plist_test.go
diff -u pkgsrc/pkgtools/pkglint/files/plist_test.go:1.7 pkgsrc/pkgtools/pkglint/files/plist_test.go:1.8
--- pkgsrc/pkgtools/pkglint/files/plist_test.go:1.7     Sat Jul  9 09:43:48 2016
+++ pkgsrc/pkgtools/pkglint/files/plist_test.go Sat Jul  9 13:16:43 2016
@@ -167,3 +167,44 @@ func (s *Suite) Test_PlistChecker_checkp
 
        c.Check(s.Output(), equals, "NOTE: PLIST:2: The .gz extension is unnecessary for manual pages.\n")
 }
+
+func (s *Suite) Test_PlistChecker__autofix(c *check.C) {
+       s.UseCommandLine(c, "-Wall")
+
+       fname := s.CreateTmpFileLines(c, "PLIST",
+               "@comment $"+"NetBSD$",
+               "lib/libvirt/connection-driver/libvirt_driver_storage.la",
+               "${PLIST.hal}lib/libvirt/connection-driver/libvirt_driver_nodedev.la",
+               "${PLIST.xen}lib/libvirt/connection-driver/libvirt_driver_libxl.la",
+               "lib/libvirt/lock-driver/lockd.la",
+               "share/augeas/lenses/virtlockd.aug",
+               "share/doc/${PKGNAME}/html/32favicon.png",
+               "share/doc/${PKGNAME}/html/404.html",
+               "share/doc/${PKGNAME}/html/acl.html",
+               "share/doc/${PKGNAME}/html/aclpolkit.html",
+               "share/doc/${PKGNAME}/html/windows.html",
+               "share/examples/libvirt/libvirt.conf",
+               "share/locale/zh_CN/LC_MESSAGES/libvirt.mo",
+               "share/locale/zh_TW/LC_MESSAGES/libvirt.mo",
+               "share/locale/zu/LC_MESSAGES/libvirt.mo",
+               "@pkgdir share/examples/libvirt/nwfilter",
+               "@pkgdir        etc/libvirt/qemu/networks/autostart",
+               "@pkgdir        etc/logrotate.d",
+               "@pkgdir        etc/sasl2")
+       lines := LoadExistingLines(fname, false)
+       ChecklinesPlist(lines)
+
+       c.Check(s.Output(), equals, ""+
+               "WARN: ~/PLIST:3: \"lib/libvirt/connection-driver/libvirt_driver_nodedev.la\" should be sorted before \"lib/libvirt/connection-driver/libvirt_driver_storage.la\".\n"+
+               "WARN: ~/PLIST:4: \"lib/libvirt/connection-driver/libvirt_driver_libxl.la\" should be sorted before \"lib/libvirt/connection-driver/libvirt_driver_nodedev.la\".\n")
+
+       s.UseCommandLine(c, "-Wall", "--autofix")
+       ChecklinesPlist(lines)
+
+       fixedLines := LoadExistingLines(fname, false)
+
+       c.Check(s.Output(), equals, ""+
+               "AUTOFIX: ~/PLIST:1: Sorting the whole file.\n"+
+               "AUTOFIX: ~/PLIST: Has been auto-fixed. Please re-run pkglint.\n")
+       c.Check(len(lines), equals, len(fixedLines))
+}



Home | Main Index | Thread Index | Old Index