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:           Tue Oct  6 18:40:50 UTC 2020

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: homepage.go homepage_test.go pkgsrc.go
            pkgsrc_test.go shell_test.go

Log Message:
pkgtools/pkglint: update to 20.3.1

Changes since 20.3.0:

URLs from cpan.metacpan.org should not be used as HOMEPAGE for Perl
packages since they don't provide an overview over the package, instead
the just list the distribution files.

Lines in doc/CHANGES may contain the pattern "Removed <pkgpath> version
<version>".  Before, only "Removed <pkgpath>" (without additional
information) or "Removed <pkgpath> successor <pkgpath>" were allowed.
Mentioning the last seen version number sounds useful.  It is not
cross-checked right now; that check may be added later.


To generate a diff of this commit:
cvs rdiff -u -r1.670 -r1.671 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkglint/files/homepage.go
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/pkglint/files/homepage_test.go
cvs rdiff -u -r1.57 -r1.58 pkgsrc/pkgtools/pkglint/files/pkgsrc.go
cvs rdiff -u -r1.50 -r1.51 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
cvs rdiff -u -r1.70 -r1.71 pkgsrc/pkgtools/pkglint/files/shell_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.670 pkgsrc/pkgtools/pkglint/Makefile:1.671
--- pkgsrc/pkgtools/pkglint/Makefile:1.670      Fri Sep 25 13:56:09 2020
+++ pkgsrc/pkgtools/pkglint/Makefile    Tue Oct  6 18:40:50 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.670 2020/09/25 13:56:09 rillig Exp $
+# $NetBSD: Makefile,v 1.671 2020/10/06 18:40:50 rillig Exp $
 
-PKGNAME=       pkglint-20.3.0
+PKGNAME=       pkglint-20.3.1
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/homepage.go
diff -u pkgsrc/pkgtools/pkglint/files/homepage.go:1.4 pkgsrc/pkgtools/pkglint/files/homepage.go:1.5
--- pkgsrc/pkgtools/pkglint/files/homepage.go:1.4       Sat Feb 15 13:48:40 2020
+++ pkgsrc/pkgtools/pkglint/files/homepage.go   Tue Oct  6 18:40:50 2020
@@ -236,7 +236,8 @@ func (ck *HomepageChecker) checkBadUrls(
 
        if !ck.hasAnySuffix(host,
                ".dl.sourceforge.net",
-               "downloads.sourceforge.net") {
+               "downloads.sourceforge.net",
+               "cpan.metacpan.org") {
                return
        }
 

Index: pkgsrc/pkgtools/pkglint/files/homepage_test.go
diff -u pkgsrc/pkgtools/pkglint/files/homepage_test.go:1.6 pkgsrc/pkgtools/pkglint/files/homepage_test.go:1.7
--- pkgsrc/pkgtools/pkglint/files/homepage_test.go:1.6  Fri Jun 12 19:14:45 2020
+++ pkgsrc/pkgtools/pkglint/files/homepage_test.go      Tue Oct  6 18:40:50 2020
@@ -279,11 +279,13 @@ func (s *Suite) Test_HomepageChecker_che
        vt.Varname("HOMEPAGE")
        vt.Values(
                "http://garr.dl.sourceforge.net/project/name/dir/subdir/";,
-               "https://downloads.sourceforge.net/project/name/dir/subdir/";)
+               "https://downloads.sourceforge.net/project/name/dir/subdir/";,
+               "https://cpan.metacpan.org/authors/id/I/IM/IMALPASS/";)
 
        vt.Output(
                "WARN: filename.mk:1: A direct download URL is not a user-friendly homepage.",
-               "WARN: filename.mk:2: A direct download URL is not a user-friendly homepage.")
+               "WARN: filename.mk:2: A direct download URL is not a user-friendly homepage.",
+               "WARN: filename.mk:3: A direct download URL is not a user-friendly homepage.")
 }
 
 func (s *Suite) Test_HomepageChecker_checkReachable(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/pkgsrc.go
diff -u pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.57 pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.58
--- pkgsrc/pkgtools/pkglint/files/pkgsrc.go:1.57        Sun Jun  7 15:49:23 2020
+++ pkgsrc/pkgtools/pkglint/files/pkgsrc.go     Tue Oct  6 18:40:50 2020
@@ -370,7 +370,7 @@ func (*Pkgsrc) parseDocChange(line *Line
                action == Added && f[2] == "version",
                action == Updated && f[2] == "to",
                action == Downgraded && f[2] == "to",
-               action == Removed && (f[2] == "successor" || n == 4),
+               action == Removed && (f[2] == "successor" || f[2] == "version" || n == 4),
                (action == Renamed || action == Moved) && f[2] == "to":
                return &Change{
                        Location: line.Location,
@@ -1318,8 +1318,10 @@ func (ch *Change) Target() PkgsrcPath {
        return NewPkgsrcPath(NewPath(ch.target))
 }
 
-// Successor returns the successor for a Removed package.
-func (ch *Change) Successor() string {
+// SuccessorOrVersion returns the successor for a Removed package,
+// or the version number of its last appearance.
+// As of 2020-10-06, no cross-validation is done on this field though.
+func (ch *Change) SuccessorOrVersion() string {
        assert(ch.Action == Removed)
        return ch.target
 }

Index: pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.50 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.51
--- pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.50   Sun Jun  7 15:49:23 2020
+++ pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go        Tue Oct  6 18:40:50 2020
@@ -477,6 +477,10 @@ func (s *Suite) Test_Pkgsrc_parseDocChan
        test("\tRemoved pkgpath successor pkgpath [author 2019-01-01]",
                nil...)
 
+       // Since 2020-10-06
+       test("\tRemoved pkgpath version 1.3.4 [author 2019-01-01]",
+               nil...)
+
        // "and" is wrong
        test("\tRemoved pkgpath and pkgpath [author 2019-01-01]",
                "WARN: doc/CHANGES-2019:123: Invalid doc/CHANGES line: "+
@@ -1529,17 +1533,19 @@ func (s *Suite) Test_Change_Target(c *ch
        t.ExpectAssert(func() { downgraded.Target() })
 }
 
-func (s *Suite) Test_Change_Successor(c *check.C) {
+func (s *Suite) Test_Change_SuccessorOrVersion(c *check.C) {
        t := s.Init(c)
 
        loc := Location{"doc/CHANGES-2019", 5}
        removed := Change{loc, Removed, "category/path", "", "author", "2019-01-01"}
        removedSucc := Change{loc, Removed, "category/path", "category/successor", "author", "2019-01-01"}
+       removedVersion := Change{loc, Removed, "category/path", "1.3.4", "author", "2019-01-01"}
        downgraded := Change{loc, Downgraded, "category/path", "1.0", "author", "2019-01-01"}
 
-       t.CheckEquals(removed.Successor(), "")
-       t.CheckEquals(removedSucc.Successor(), "category/successor")
-       t.ExpectAssert(func() { downgraded.Successor() })
+       t.CheckEquals(removed.SuccessorOrVersion(), "")
+       t.CheckEquals(removedSucc.SuccessorOrVersion(), "category/successor")
+       t.CheckEquals(removedVersion.SuccessorOrVersion(), "1.3.4")
+       t.ExpectAssert(func() { downgraded.SuccessorOrVersion() })
 }
 
 func (s *Suite) Test_Change_IsAbove(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/shell_test.go
diff -u pkgsrc/pkgtools/pkglint/files/shell_test.go:1.70 pkgsrc/pkgtools/pkglint/files/shell_test.go:1.71
--- pkgsrc/pkgtools/pkglint/files/shell_test.go:1.70    Wed Jul  1 13:17:41 2020
+++ pkgsrc/pkgtools/pkglint/files/shell_test.go Tue Oct  6 18:40:50 2020
@@ -1030,6 +1030,50 @@ func (s *Suite) Test_ShellLineChecker_Ch
        t.CheckOutputEmpty()
 }
 
+// After working a lot with usr.bin/make, I thought that lines containing
+// the cd command would differ in behavior between compatibility mode and
+// parallel mode.  But since pkgsrc does not support parallel mode and also
+// actively warns when someone tries to run it in parallel mode, there is
+// no point checking for chdir that might spill over to the next line.
+// That will not happen in compat mode.
+func (s *Suite) Test_ShellLineChecker_CheckShellCommandLine__chdir(c *check.C) {
+       t := s.Init(c)
+
+       t.SetUpTool("echo", "", AfterPrefsMk)
+       t.SetUpTool("sed", "", AfterPrefsMk)
+       mklines := t.NewMkLines("filename.mk",
+               MkCvsID,
+               "",
+               "pre-configure:",
+               // This command is run in the current directory.
+               "\techo command 1",
+               // This chdir affects the remaining commands.
+               // It might be possible to warn here about chdir.
+               "\tcd ..",
+               // In subshells, chdir is ok.
+               "\t(cd ..)",
+               // In pipes, chdir is ok.
+               "\t{ cd .. && echo sender; } | { cd .. && sed s,sender,receiver; }",
+               // The && operator does not run in a subshell.
+               // It might be possible to warn here about chdir.
+               "\tcd .. && echo",
+               // The || operator does not run in a subshell.
+               // It might be possible to warn here about chdir.
+               "\tcd .. || echo",
+               // The current directory of this command depends on the preceding
+               // commands.
+               "\techo command 2",
+               // In the final command of a target, chdir is ok since there are
+               // no further commands that could be affected.
+               "\tcd ..")
+
+       mklines.Check()
+
+       t.CheckOutputLines(
+               "WARN: filename.mk:7: The exitcode of the command at the left of " +
+                       "the | operator is ignored.")
+}
+
 func (s *Suite) Test_ShellLineChecker_CheckShellCommandLine__nofix(c *check.C) {
        t := s.Init(c)
 



Home | Main Index | Thread Index | Old Index