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:           Thu Oct 28 20:15:25 UTC 2021

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: check_test.go distinfo.go
            distinfo_test.go homepage.go package_test.go pkglint_test.go

Log Message:
pkglint: update to 21.3.2

Changes since 21.3.1:

Replace RMD160 with BLAKE2s for distfiles in main pkgsrc, keep the
previous RMD160 for pkgsrc-wip, at least until 2021Q4.


To generate a diff of this commit:
cvs rdiff -u -r1.700 -r1.701 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.76 -r1.77 pkgsrc/pkgtools/pkglint/files/check_test.go
cvs rdiff -u -r1.47 -r1.48 pkgsrc/pkgtools/pkglint/files/distinfo.go
cvs rdiff -u -r1.45 -r1.46 pkgsrc/pkgtools/pkglint/files/distinfo_test.go
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkglint/files/homepage.go
cvs rdiff -u -r1.87 -r1.88 pkgsrc/pkgtools/pkglint/files/package_test.go
cvs rdiff -u -r1.70 -r1.71 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.700 pkgsrc/pkgtools/pkglint/Makefile:1.701
--- pkgsrc/pkgtools/pkglint/Makefile:1.700      Sat Oct  9 08:33:09 2021
+++ pkgsrc/pkgtools/pkglint/Makefile    Thu Oct 28 20:15:25 2021
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.700 2021/10/09 08:33:09 rillig Exp $
+# $NetBSD: Makefile,v 1.701 2021/10/28 20:15:25 rillig Exp $
 
-PKGNAME=       pkglint-21.3.1
+PKGNAME=       pkglint-21.3.2
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/check_test.go
diff -u pkgsrc/pkgtools/pkglint/files/check_test.go:1.76 pkgsrc/pkgtools/pkglint/files/check_test.go:1.77
--- pkgsrc/pkgtools/pkglint/files/check_test.go:1.76    Fri Jun 25 14:15:01 2021
+++ pkgsrc/pkgtools/pkglint/files/check_test.go Thu Oct 28 20:15:25 2021
@@ -479,8 +479,7 @@ func (t *Tester) SetUpPackage(pkgpath Re
        t.CreateFileLines(pkgpath.JoinNoClean("distinfo"),
                CvsID,
                "",
-               "SHA1 (distfile-1.0.tar.gz) = 12341234",
-               "RMD160 (distfile-1.0.tar.gz) = 12341234",
+               "BLAKE2s (distfile-1.0.tar.gz) = 12341234",
                "SHA512 (distfile-1.0.tar.gz) = 12341234",
                "Size (distfile-1.0.tar.gz) = 12341234")
 

Index: pkgsrc/pkgtools/pkglint/files/distinfo.go
diff -u pkgsrc/pkgtools/pkglint/files/distinfo.go:1.47 pkgsrc/pkgtools/pkglint/files/distinfo.go:1.48
--- pkgsrc/pkgtools/pkglint/files/distinfo.go:1.47      Sat Oct  9 08:33:09 2021
+++ pkgsrc/pkgtools/pkglint/files/distinfo.go   Thu Oct 28 20:15:25 2021
@@ -5,6 +5,7 @@ import (
        "crypto/sha1"
        "crypto/sha512"
        "encoding/hex"
+       "golang.org/x/crypto/blake2s"
        "golang.org/x/crypto/ripemd160"
        hashpkg "hash"
        "io"
@@ -146,10 +147,16 @@ func (ck *distinfoLinesChecker) checkAlg
        switch {
        case algorithms == "SHA1" && isPatch != no:
                return
-       case algorithms == "RMD160, SHA512, Size" && isPatch != yes:
+       case algorithms == "BLAKE2s, SHA512, Size" && isPatch != yes:
+               return
+       case G.Wip && algorithms == "RMD160, SHA512, Size" && isPatch != yes:
+               // TODO: remove after 2021Q4. Until then, allow pkgsrc-wip to
+               //  be used with the stable 2021Q3.
+               return
+       case G.Wip && algorithms == "SHA1, BLAKE2s, SHA512, Size" && isPatch != yes:
+               // TODO: remove after 2021Q4. Until then, allow pkgsrc-wip to
+               //  be used with the stable 2021Q3.
                return
-       case algorithms == "SHA1, RMD160, SHA512, Size" && isPatch != yes:
-               return // TODO: remove as of 2021Q3
        }
 
        switch {
@@ -160,7 +167,7 @@ func (ck *distinfoLinesChecker) checkAlg
                line.Errorf("Wrong checksum algorithms %s for %s.", algorithms, filename)
                line.Explain(
                        "Distfiles that are downloaded from external sources must have the",
-                       "checksum algorithms RMD160, SHA512, Size.",
+                       "checksum algorithms BLAKE2s, SHA512, Size.",
                        "",
                        "Patch files from pkgsrc must have only the SHA1 hash.")
 
@@ -191,10 +198,10 @@ func (ck *distinfoLinesChecker) checkAlg
 // added to the distinfo file via an autofix.
 func (ck *distinfoLinesChecker) checkAlgorithmsDistfile(info distinfoFileInfo) {
        line := info.line()
-       line.Errorf("Expected RMD160, SHA512, Size checksums for %q, got %s.",
+       line.Errorf("Expected BLAKE2s, SHA512, Size checksums for %q, got %s.",
                info.filename(), info.algorithms())
 
-       algorithms := [...]string{"RMD160", "SHA512", "Size"}
+       algorithms := [...]string{"BLAKE2s", "SHA512", "Size"}
 
        missing := map[string]bool{}
        for _, alg := range algorithms {
@@ -266,8 +273,12 @@ func (ck *distinfoLinesChecker) checkAlg
                switch alg {
                case "SHA1":
                        return computeHash(sha1.New())
-               case "RMD160":
+               case "RMD160": // TODO: remove after 2021Q4
                        return computeHash(ripemd160.New())
+               case "BLAKE2s":
+                       blake, err := blake2s.New256(nil)
+                       assertNil(err, "blake2s")
+                       return computeHash(blake)
                case "SHA512":
                        return computeHash(sha512.New())
                default:
@@ -447,7 +458,9 @@ func (info *distinfoFileInfo) algorithms
 
 func (info *distinfoFileInfo) hasDistfileAlgorithms() bool {
        h := info.hashes
-       if len(h) == 4 && // TODO: remove as of 2021Q3
+       // TODO: remove after 2021Q4. Until then, allow pkgsrc-wip to
+       //  be used with the stable 2021Q3.
+       if G.Wip && len(h) == 4 &&
                h[0].algorithm == "SHA1" &&
                h[1].algorithm == "RMD160" &&
                h[2].algorithm == "SHA512" &&
@@ -455,7 +468,7 @@ func (info *distinfoFileInfo) hasDistfil
                return true
        }
        return len(h) == 3 &&
-               h[0].algorithm == "RMD160" &&
+               h[0].algorithm == "BLAKE2s" &&
                h[1].algorithm == "SHA512" &&
                h[2].algorithm == "Size"
 }

Index: pkgsrc/pkgtools/pkglint/files/distinfo_test.go
diff -u pkgsrc/pkgtools/pkglint/files/distinfo_test.go:1.45 pkgsrc/pkgtools/pkglint/files/distinfo_test.go:1.46
--- pkgsrc/pkgtools/pkglint/files/distinfo_test.go:1.45 Sat Oct  9 08:33:09 2021
+++ pkgsrc/pkgtools/pkglint/files/distinfo_test.go      Thu Oct 28 20:15:25 2021
@@ -31,7 +31,7 @@ func (s *Suite) Test_CheckLinesDistinfo_
                "ERROR: distinfo:1: Invalid line: should be the CVS ID",
                "ERROR: distinfo:2: Invalid line: should be empty",
                "ERROR: distinfo:8: Invalid line: Another invalid line",
-               "ERROR: distinfo:3: Expected RMD160, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got MD5, SHA1.",
+               "ERROR: distinfo:3: Expected BLAKE2s, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got MD5, SHA1.",
                "ERROR: distinfo:5: Expected SHA1 hash for patch-aa, got SHA1, Size.",
                "WARN: distinfo:9: Patch file \"patch-nonexistent\" does not exist in directory \"patches\".")
 }
@@ -238,20 +238,16 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (ok-1.0.tar.gz) = 1234",
-               "RMD160 (ok-1.0.tar.gz) = 1234",
+               "BLAKE2s (ok-1.0.tar.gz) = 1234",
                "SHA512 (ok-1.0.tar.gz) = 1234",
                "Size (ok-1.0.tar.gz) = 1234",
-               "SHA1 (not-ok.tar.gz) = 1234",
-               "RMD160 (not-ok.tar.gz) = 1234",
+               "BLAKE2s (not-ok.tar.gz) = 1234",
                "SHA512 (not-ok.tar.gz) = 1234",
                "Size (not-ok.tar.gz) = 1234",
-               "SHA1 (non-versioned/not-ok.tar.gz) = 1234",
-               "RMD160 (non-versioned/not-ok.tar.gz) = 1234",
+               "BLAKE2s (non-versioned/not-ok.tar.gz) = 1234",
                "SHA512 (non-versioned/not-ok.tar.gz) = 1234",
                "Size (non-versioned/not-ok.tar.gz) = 1234",
-               "SHA1 (versioned-1/ok.tar.gz) = 1234",
-               "RMD160 (versioned-1/ok.tar.gz) = 1234",
+               "BLAKE2s (versioned-1/ok.tar.gz) = 1234",
                "SHA512 (versioned-1/ok.tar.gz) = 1234",
                "Size (versioned-1/ok.tar.gz) = 1234")
        t.Chdir("category/package")
@@ -260,9 +256,9 @@ func (s *Suite) Test_distinfoLinesChecke
        G.Check(".")
 
        t.CheckOutputLines(
-               "WARN: distinfo:7: Distfiles without version number "+
+               "WARN: distinfo:6: Distfiles without version number "+
                        "should be placed in a versioned DIST_SUBDIR.",
-               "WARN: distinfo:11: Distfiles without version number "+
+               "WARN: distinfo:9: Distfiles without version number "+
                        "should be placed in a versioned DIST_SUBDIR.")
 }
 
@@ -283,7 +279,7 @@ func (s *Suite) Test_distinfoLinesChecke
        // a patch, it is a normal distfile because it has other hash algorithms
        // than exactly SHA1.
        t.CheckOutputLines(
-               "ERROR: distinfo:3: Expected RMD160, SHA512, Size checksums " +
+               "ERROR: distinfo:3: Expected BLAKE2s, SHA512, Size checksums " +
                        "for \"patch-5.3.tar.gz\", got MD5, SHA1.")
 }
 
@@ -300,7 +296,7 @@ func (s *Suite) Test_distinfoLinesChecke
        CheckLinesDistinfo(nil, lines)
 
        t.CheckOutputLines(
-               "ERROR: distinfo:3: Expected RMD160, SHA512, Size checksums " +
+               "ERROR: distinfo:3: Expected BLAKE2s, SHA512, Size checksums " +
                        "for \"distfile.tar.gz\", got MD5, SHA1.")
 }
 
@@ -326,7 +322,7 @@ func (s *Suite) Test_distinfoLinesChecke
                "ERROR: distinfo:3: Wrong checksum algorithms MD5 for patch-4.2.tar.gz.",
                "",
                "\tDistfiles that are downloaded from external sources must have the",
-               "\tchecksum algorithms RMD160, SHA512, Size.",
+               "\tchecksum algorithms BLAKE2s, SHA512, Size.",
                "",
                "\tPatch files from pkgsrc must have only the SHA1 hash.",
                "")
@@ -360,8 +356,7 @@ func (s *Suite) Test_distinfoLinesChecke
        lines := t.SetUpFileLines("distinfo",
                CvsID,
                "",
-               "SHA1 (patch-aa) = ...",
-               "RMD160 (patch-aa) = ...",
+               "BLAKE2s (patch-aa) = ...",
                "SHA512 (patch-aa) = ...",
                "Size (patch-aa) = ... bytes")
 
@@ -369,7 +364,7 @@ func (s *Suite) Test_distinfoLinesChecke
 
        // The file name certainly looks like a pkgsrc patch, but there
        // is no corresponding file in the file system, and there is no
-       // current package to correctly determine the PATCHDIR. Therefore
+       // current package to correctly determine the PATCHDIR. Therefore,
        // pkglint doesn't know whether this is a distfile or a missing
        // patch file and doesn't warn at all.
        t.CheckOutputEmpty()
@@ -382,8 +377,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (patch-aa) = ...",
-               "RMD160 (patch-aa) = ...",
+               "BLAKE2s (patch-aa) = ...",
                "SHA512 (patch-aa) = ...",
                "Size (patch-aa) = ... bytes")
        t.CreateFileDummyPatch("category/package/patches/patch-aa")
@@ -398,11 +392,8 @@ func (s *Suite) Test_distinfoLinesChecke
        // that the distinfo lines clearly refer to that patch file and not
        // to a distfile.
        t.CheckOutputLines(
-               "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected SHA1 hash for patch-aa, got SHA1, RMD160, SHA512, Size.",
-               "ERROR: ~/category/package/distinfo:3: "+
-                       "SHA1 hash of patches/patch-aa differs (distinfo has ..., "+
-                       "patch file has 9a93207561abfef7e7550598c5a08f2c3226995b).")
+               "ERROR: ~/category/package/distinfo:3: " +
+                       "Expected SHA1 hash for patch-aa, got BLAKE2s, SHA512, Size.")
 }
 
 func (s *Suite) Test_distinfoLinesChecker_checkAlgorithms__missing_patch_with_wrong_algorithms(c *check.C) {
@@ -412,7 +403,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.SetUpFileLines("category/package/distinfo",
                CvsID,
                "",
-               "RMD160 (patch-aa) = ...")
+               "BLAKE2s (patch-aa) = ...")
        t.FinishSetUp()
 
        G.Check(t.File("category/package"))
@@ -422,7 +413,7 @@ func (s *Suite) Test_distinfoLinesChecke
        // therefore it requires the usual distfile checksum algorithms here.
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: " +
-                       "Expected RMD160, SHA512, Size checksums for \"patch-aa\", got RMD160.")
+                       "Expected BLAKE2s, SHA512, Size checksums for \"patch-aa\", got BLAKE2s.")
 }
 
 // When there is at least one correct hash for a distfile and the distfile
@@ -436,21 +427,21 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "RMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a",
+               "BLAKE2s (package-1.0.txt) = ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59",
                "Size (package-1.0.txt) = 13 bytes",
                "CRC32 (package-1.0.txt) = asdf")
        t.CreateFileLines("distfiles/package-1.0.txt",
                "hello, world")
        t.FinishSetUp()
 
-       // This run is only used to verify that the RMD160 hash is correct, and if
+       // This run is only used to verify that the BLAKE2s hash is correct, and if
        // it should ever differ, the correct hash will appear in an error message.
        G.Check(t.File("category/package"))
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", "+
-                       "got RMD160, Size, CRC32.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", "+
+                       "got BLAKE2s, Size, CRC32.",
                "ERROR: ~/category/package/distinfo:3: Missing SHA512 hash for package-1.0.txt.")
 
        t.SetUpCommandLine("-Wall", "--autofix", "--show-autofix", "--source")
@@ -466,7 +457,7 @@ func (s *Suite) Test_distinfoLinesChecke
                        "Inserting a line \"SHA512 (package-1.0.txt) "+
                        "= f65f341b35981fda842b09b2c8af9bcdb7602a4c2e6fa1f7d41f0974d3e3122f"+
                        "268fc79d5a4af66358f5133885cd1c165c916f80ab25e5d8d95db46f803c782c\" below this line.",
-               ">\tRMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a",
+               ">\tBLAKE2s (package-1.0.txt) = ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59",
                "+\tSHA512 (package-1.0.txt) = f65f341b35981fda842b09b2c8af9bcdb7602a4c2e6fa1f7d41f0974d3e3122f"+
                        "268fc79d5a4af66358f5133885cd1c165c916f80ab25e5d8d95db46f803c782c")
 
@@ -476,8 +467,8 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: " +
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", " +
-                       "got RMD160, SHA512, Size, CRC32.")
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", " +
+                       "got BLAKE2s, SHA512, Size, CRC32.")
 }
 
 // When some of the hashes for a distfile are missing, pkglint can calculate
@@ -494,7 +485,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "RMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a",
+               "BLAKE2s (package-1.0.txt) = ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59",
                "Size (package-1.0.txt) = 13 bytes",
                "CRC32 (package-1.0.txt) = asdf")
        t.FinishSetUp()
@@ -503,8 +494,8 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", "+
-                       "got RMD160, Size, CRC32.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", "+
+                       "got BLAKE2s, Size, CRC32.",
                "",
                "\tTo add the missing lines to the distinfo file, run",
                "\t\t"+confMake+" distinfo",
@@ -538,7 +529,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "RMD160 (package-1.0.txt) = 1234wrongHash1234")
+               "BLAKE2s (package-1.0.txt) = 1234wrongHash1234")
        t.CreateFileLines("distfiles/package-1.0.txt",
                "hello, world")
        t.FinishSetUp()
@@ -547,11 +538,11 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", "+
-                       "got RMD160.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", "+
+                       "got BLAKE2s.",
                "ERROR: ~/category/package/distinfo:3: "+
-                       "The RMD160 checksum for \"package-1.0.txt\" is 1234wrongHash1234 in distinfo, "+
-                       "1a88147a0344137404c63f3b695366eab869a98a in ../../distfiles/package-1.0.txt.")
+                       "The BLAKE2s checksum for \"package-1.0.txt\" is 1234wrongHash1234 in distinfo, "+
+                       "ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59 in ../../distfiles/package-1.0.txt.")
 }
 
 func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__no_usual_algorithm(c *check.C) {
@@ -570,11 +561,11 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: " +
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", " +
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", " +
                        "got MD5.")
 }
 
-func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__top_algorithms_missing(c *check.C) {
+func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__top_algorithm_missing(c *check.C) {
        t := s.Init(c)
 
        t.SetUpPackage("category/package")
@@ -592,9 +583,9 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", "+
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", "+
                        "got SHA512, Size.",
-               "ERROR: ~/category/package/distinfo:3: Missing RMD160 hash for package-1.0.txt.")
+               "ERROR: ~/category/package/distinfo:3: Missing BLAKE2s hash for package-1.0.txt.")
 }
 
 func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__bottom_algorithms_missing(c *check.C) {
@@ -604,8 +595,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (package-1.0.txt) = cd50d19784897085a8d0e3e413f8612b097c03f1",
-               "RMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a")
+               "BLAKE2s (package-1.0.txt) = ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59")
        t.CreateFileLines("distfiles/package-1.0.txt",
                "hello, world")
        t.FinishSetUp()
@@ -614,8 +604,8 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", "+
-                       "got SHA1, RMD160.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", "+
+                       "got BLAKE2s.",
                "ERROR: ~/category/package/distinfo:3: Missing SHA512 hash for package-1.0.txt.",
                "ERROR: ~/category/package/distinfo:3: Missing Size hash for package-1.0.txt.")
 
@@ -627,9 +617,9 @@ func (s *Suite) Test_distinfoLinesChecke
                "AUTOFIX: ~/category/package/distinfo:3: "+
                        "Inserting a line \"SHA512 (package-1.0.txt) = f65f341b35981fda842b"+
                        "09b2c8af9bcdb7602a4c2e6fa1f7d41f0974d3e3122f268fc79d5a4af66358f513"+
-                       "3885cd1c165c916f80ab25e5d8d95db46f803c782c\" above this line.",
+                       "3885cd1c165c916f80ab25e5d8d95db46f803c782c\" below this line.",
                "AUTOFIX: ~/category/package/distinfo:3: "+
-                       "Inserting a line \"Size (package-1.0.txt) = 13 bytes\" above this line.")
+                       "Inserting a line \"Size (package-1.0.txt) = 13 bytes\" below this line.")
 }
 
 func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__algorithms_in_wrong_order(c *check.C) {
@@ -639,32 +629,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "RMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a",
-               "Size (package-1.0.txt) = 13 bytes",
-               "SHA512 (package-1.0.txt) = f65f341b35981fda842b09b2c8af9bcdb7602a4c2e6fa1f7"+
-                       "d41f0974d3e3122f268fc79d5a4af66358f5133885cd1c165c916f80ab25e5d8d95db46f803c782c")
-
-       t.CreateFileLines("distfiles/package-1.0.txt",
-               "hello, world")
-       t.FinishSetUp()
-
-       G.Check(t.File("category/package"))
-
-       // This case doesn't happen in practice, therefore there's no autofix for it.
-       t.CheckOutputLines(
-               "ERROR: ~/category/package/distinfo:3: " +
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", " +
-                       "got RMD160, Size, SHA512.")
-}
-
-func (s *Suite) Test_distinfoLinesChecker_checkAlgorithmsDistfile__some_algorithms_in_wrong_order(c *check.C) {
-       t := s.Init(c)
-
-       t.SetUpPackage("category/package")
-       t.CreateFileLines("category/package/distinfo",
-               CvsID,
-               "",
-               "RMD160 (package-1.0.txt) = 1a88147a0344137404c63f3b695366eab869a98a",
+               "BLAKE2s (package-1.0.txt) = ee494623e60caeda840ed7de4fb70db4a36bc92b445b09f12b9ed46094e9bd59",
                "Size (package-1.0.txt) = 13 bytes",
                "SHA512 (package-1.0.txt) = f65f341b35981fda842b09b2c8af9bcdb7602a4c2e6fa1f7"+
                        "d41f0974d3e3122f268fc79d5a4af66358f5133885cd1c165c916f80ab25e5d8d95db46f803c782c")
@@ -678,8 +643,8 @@ func (s *Suite) Test_distinfoLinesChecke
        // This case doesn't happen in practice, therefore there's no autofix for it.
        t.CheckOutputLines(
                "ERROR: ~/category/package/distinfo:3: " +
-                       "Expected RMD160, SHA512, Size checksums for \"package-1.0.txt\", " +
-                       "got RMD160, Size, SHA512.")
+                       "Expected BLAKE2s, SHA512, Size checksums for \"package-1.0.txt\", " +
+                       "got BLAKE2s, Size, SHA512.")
 }
 
 func (s *Suite) Test_distinfoLinesChecker_checkUnrecordedPatches(c *check.C) {
@@ -693,8 +658,7 @@ func (s *Suite) Test_distinfoLinesChecke
        t.SetUpFileLines("distinfo",
                CvsID,
                "",
-               "SHA1 (distfile.tar.gz) = ...",
-               "RMD160 (distfile.tar.gz) = ...",
+               "BLAKE2s (distfile.tar.gz) = ...",
                "SHA512 (distfile.tar.gz) = ...",
                "Size (distfile.tar.gz) = 1024 bytes")
        t.FinishSetUp()
@@ -751,21 +715,21 @@ func (s *Suite) Test_distinfoLinesChecke
 
        t.CheckOutputLines(
                "ERROR: ~/category/package1/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got SHA512.",
                "ERROR: ~/category/package1/distinfo:4: "+
-                       "Expected RMD160, SHA512, Size checksums for \"distfile-1.1.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"distfile-1.1.tar.gz\", got SHA512.",
                "ERROR: ~/category/package1/distinfo:5: "+
-                       "Expected RMD160, SHA512, Size checksums for \"patch-4.2.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"patch-4.2.tar.gz\", got SHA512.",
 
                "ERROR: ~/category/package2/distinfo:3: "+
-                       "Expected RMD160, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"distfile-1.0.tar.gz\", got SHA512.",
                "ERROR: ~/category/package2/distinfo:3: "+
                        "The SHA512 hash for distfile-1.0.tar.gz is 1234567822222222, "+
                        "which conflicts with 1234567811111111 in ../../category/package1/distinfo:3.",
                "ERROR: ~/category/package2/distinfo:4: "+
-                       "Expected RMD160, SHA512, Size checksums for \"distfile-1.1.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"distfile-1.1.tar.gz\", got SHA512.",
                "ERROR: ~/category/package2/distinfo:5: "+
-                       "Expected RMD160, SHA512, Size checksums for \"encoding-error.tar.gz\", got SHA512.",
+                       "Expected BLAKE2s, SHA512, Size checksums for \"encoding-error.tar.gz\", got SHA512.",
                "ERROR: ~/category/package2/distinfo:5: "+
                        "The SHA512 hash for encoding-error.tar.gz contains a non-hex character.",
 
@@ -931,7 +895,7 @@ func (s *Suite) Test_distinfoFileInfo_ha
                CvsID,
                "",
                "other (dist-a.tar.gz) = 1234",
-               "RMD160 (dist-a.tar.gz) = 1234",
+               "BLAKE2s (dist-a.tar.gz) = 1234",
                "SHA512 (dist-a.tar.gz) = 1234",
                "Size (dist-a.tar.gz) = 1234",
 
@@ -941,12 +905,12 @@ func (s *Suite) Test_distinfoFileInfo_ha
                "Size (dist-b.tar.gz) = 1234",
 
                "SHA1 (dist-c.tar.gz) = 1234",
-               "RMD160 (dist-c.tar.gz) = 1234",
+               "BLAKE2s (dist-c.tar.gz) = 1234",
                "other (dist-c.tar.gz) = 1234",
                "Size (dist-c.tar.gz) = 1234",
 
                "SHA1 (dist-d.tar.gz) = 1234",
-               "RMD160 (dist-d.tar.gz) = 1234",
+               "BLAKE2s (dist-d.tar.gz) = 1234",
                "SHA512 (dist-d.tar.gz) = 1234",
                "other (dist-d.tar.gz) = 1234")
        t.Chdir("category/package")
@@ -955,14 +919,14 @@ func (s *Suite) Test_distinfoFileInfo_ha
        G.Check(".")
 
        t.CheckOutputLines(
-               "ERROR: distinfo:3: Expected RMD160, SHA512, Size checksums for "+
-                       "\"dist-a.tar.gz\", got other, RMD160, SHA512, Size.",
-               "ERROR: distinfo:7: Expected RMD160, SHA512, Size checksums for "+
+               "ERROR: distinfo:3: Expected BLAKE2s, SHA512, Size checksums for "+
+                       "\"dist-a.tar.gz\", got other, BLAKE2s, SHA512, Size.",
+               "ERROR: distinfo:7: Expected BLAKE2s, SHA512, Size checksums for "+
                        "\"dist-b.tar.gz\", got SHA1, other, SHA512, Size.",
-               "ERROR: distinfo:11: Expected RMD160, SHA512, Size checksums for "+
-                       "\"dist-c.tar.gz\", got SHA1, RMD160, other, Size.",
-               "ERROR: distinfo:15: Expected RMD160, SHA512, Size checksums for "+
-                       "\"dist-d.tar.gz\", got SHA1, RMD160, SHA512, other.")
+               "ERROR: distinfo:11: Expected BLAKE2s, SHA512, Size checksums for "+
+                       "\"dist-c.tar.gz\", got SHA1, BLAKE2s, other, Size.",
+               "ERROR: distinfo:15: Expected BLAKE2s, SHA512, Size checksums for "+
+                       "\"dist-d.tar.gz\", got SHA1, BLAKE2s, SHA512, other.")
 }
 
 func (s *Suite) Test_computePatchSha1Hex(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/homepage.go
diff -u pkgsrc/pkgtools/pkglint/files/homepage.go:1.5 pkgsrc/pkgtools/pkglint/files/homepage.go:1.6
--- pkgsrc/pkgtools/pkglint/files/homepage.go:1.5       Tue Oct  6 18:40:50 2020
+++ pkgsrc/pkgtools/pkglint/files/homepage.go   Thu Oct 28 20:15:25 2021
@@ -338,19 +338,13 @@ func (*HomepageChecker) hasAnySuffix(s s
 
 func (*HomepageChecker) classifyNetworkError(err error) string {
        cause := err
-       for {
-               // Unwrap was added in Go 1.13.
-               // See https://github.com/golang/go/issues/36781
-               if unwrap, ok := cause.(interface{ Unwrap() error }); ok {
-                       cause = unwrap.Unwrap()
-                       continue
-               }
-               break
+again:
+       if wrapper, ok := cause.(interface{ Unwrap() error }); ok {
+               cause = wrapper.Unwrap()
+               goto again
        }
 
-       // DNSError.IsNotFound was added in Go 1.13.
-       // See https://github.com/golang/go/issues/28635
-       if cause, ok := cause.(*net.DNSError); ok && cause.Err == "no such host" {
+       if cause, ok := cause.(*net.DNSError); ok && cause.IsNotFound {
                return "name not found"
        }
 

Index: pkgsrc/pkgtools/pkglint/files/package_test.go
diff -u pkgsrc/pkgtools/pkglint/files/package_test.go:1.87 pkgsrc/pkgtools/pkglint/files/package_test.go:1.88
--- pkgsrc/pkgtools/pkglint/files/package_test.go:1.87  Sat Oct  9 08:33:09 2021
+++ pkgsrc/pkgtools/pkglint/files/package_test.go       Thu Oct 28 20:15:25 2021
@@ -567,8 +567,7 @@ func (s *Suite) Test_Package_loadPackage
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (distfile-1.0.tar.gz) = 12341234...",
-               "RMD160 (distfile-1.0.tar.gz) = 12341234...",
+               "BLAKE2s (distfile-1.0.tar.gz) = 12341234...",
                "SHA512 (distfile-1.0.tar.gz) = 12341234...",
                "Size (distfile-1.0.tar.gz) = 12341234...")
        t.CreateFileLines("category/package/Makefile",
@@ -1397,12 +1396,10 @@ func (s *Suite) Test_Package_checkDistfi
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (ok-3.tar.gz) = 1234",
-               "RMD160 (ok-3.tar.gz) = 1234",
+               "BLAKE2s (ok-3.tar.gz) = 1234",
                "SHA512 (ok-3.tar.gz) = 1234",
                "Size (ok-3.tar.gz) = 1234",
-               "SHA1 (package-1.0.tar.gz) = 1234",
-               "RMD160 (package-1.0.tar.gz) = 1234",
+               "BLAKE2s (package-1.0.tar.gz) = 1234",
                "SHA512 (package-1.0.tar.gz) = 1234",
                "Size (package-1.0.tar.gz) = 1234")
        t.Chdir("category/package")
@@ -1425,19 +1422,17 @@ func (s *Suite) Test_Package_checkDistfi
                ".include \"../../mk/bsd.prefs.mk\"",
                "",
                ".if ${MACHINE_ARCH} == i386",
-               "DISTFILES+=\t${UNKNOWN}",
+               "DISTFILES+=\t${UNKNOWN} missing-i386-1.0.tar.gz",
                ".endif",
                "",
-               "DISTFILES+=\tok-3.tar.gz")
+               "DISTFILES+=\tok-3.tar.gz missing-all-1.0.tar.gz")
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (ok-3.tar.gz) = 1234",
-               "RMD160 (ok-3.tar.gz) = 1234",
+               "BLAKE2s (ok-3.tar.gz) = 1234",
                "SHA512 (ok-3.tar.gz) = 1234",
                "Size (ok-3.tar.gz) = 1234",
-               "SHA1 (package-1.0.tar.gz) = 1234",
-               "RMD160 (package-1.0.tar.gz) = 1234",
+               "BLAKE2s (package-1.0.tar.gz) = 1234",
                "SHA512 (package-1.0.tar.gz) = 1234",
                "Size (package-1.0.tar.gz) = 1234")
        t.Chdir("category/package")
@@ -1445,8 +1440,15 @@ func (s *Suite) Test_Package_checkDistfi
 
        G.Check(".")
 
-       t.CheckOutputLines(
-               "WARN: Makefile:23: UNKNOWN is used but not defined.")
+       // DISTFILES refers to the missing variable UNKNOWN. Therefore, pkglint
+       // skips that part of the variable. It still checks all other files that
+       // are listed somewhere in DISTFILES.
+       t.CheckOutputLines(
+               "WARN: Makefile:23: UNKNOWN is used but not defined.",
+               "WARN: Makefile:23: Distfile \"missing-i386-1.0.tar.gz\" "+
+                       "is not mentioned in distinfo.",
+               "WARN: Makefile:26: Distfile \"missing-all-1.0.tar.gz\" "+
+                       "is not mentioned in distinfo.")
 }
 
 func (s *Suite) Test_Package_checkDistfilesInDistinfo__indirect_DIST_SUBDIR(c *check.C) {
@@ -1467,11 +1469,11 @@ func (s *Suite) Test_Package_checkDistfi
                CvsID,
                "",
                "SHA1 (package-1.0/distfile-other.tar.gz) = 1234",
-               "RMD160 (package-1.0/distfile-other.tar.gz) = 1234",
+               "BLAKE2s (package-1.0/distfile-other.tar.gz) = 1234",
                "SHA512 (package-1.0/distfile-other.tar.gz) = 1234",
                "Size (package-1.0/distfile-other.tar.gz) = 1234",
                "SHA1 (package-1.0/package-1.0.tar.gz) = 1234",
-               "RMD160 (package-1.0/package-1.0.tar.gz) = 1234",
+               "BLAKE2s (package-1.0/package-1.0.tar.gz) = 1234",
                "SHA512 (package-1.0/package-1.0.tar.gz) = 1234",
                "Size (package-1.0/package-1.0.tar.gz) = 1234")
        t.Chdir("category/package")
@@ -1499,8 +1501,7 @@ func (s *Suite) Test_Package_checkDistfi
        t.CreateFileLines("print/tex-varisize/distinfo",
                CvsID,
                "",
-               "SHA1 (tex-varisize-15878/varisize.tar.xz) = 1234",
-               "RMD160 (tex-varisize-15878/varisize.tar.xz) = 1234",
+               "BLAKE2s (tex-varisize-15878/varisize.tar.xz) = 1234",
                "SHA512 (tex-varisize-15878/varisize.tar.xz) = 1234",
                "Size (tex-varisize-15878/varisize.tar.xz) = 3176 bytes")
        t.CreateFileLines("print/texlive/package.mk",
@@ -1554,8 +1555,7 @@ func (s *Suite) Test_Package_checkDistfi
        t.CreateFileLines("category/package/distinfo",
                CvsID,
                "",
-               "SHA1 (distfile-1.0.tar.gz) = 1234",
-               "RMD160 (distfile-1.0.tar.gz) = 1234",
+               "BLAKE2s (distfile-1.0.tar.gz) = 1234",
                "SHA512 (distfile-1.0.tar.gz) = 1234",
                "Size (distfile-1.0.tar.gz) = 1234 bytes")
        t.Chdir("category/package")
@@ -1563,7 +1563,7 @@ func (s *Suite) Test_Package_checkDistfi
 
        G.Check(".")
 
-       // For completely empty distinfo files, the check is skipped.
+       // For completely empty DISTFILES, the check is skipped.
        t.CheckOutputLines(
                "WARN: distinfo: This file should not exist.")
 }

Index: pkgsrc/pkgtools/pkglint/files/pkglint_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.70 pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.71
--- pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.70  Sat Aug 14 08:19:49 2021
+++ pkgsrc/pkgtools/pkglint/files/pkglint_test.go       Thu Oct 28 20:15:25 2021
@@ -224,8 +224,7 @@ func (s *Suite) Test_Pkglint_Main__compl
        t.CreateFileLines("sysutils/checkperms/distinfo",
                CvsID,
                "",
-               "SHA1 (checkperms-1.12.tar.gz) = 34c084b4d06bcd7a8bba922ff57677e651eeced5",
-               "RMD160 (checkperms-1.12.tar.gz) = cd95029aa930b6201e9580b3ab7e36dd30b8f925",
+               "BLAKE2s (checkperms-1.12.tar.gz) = cd95029aa930b6201e9580b3ab7e36dd30b8f925",
                "SHA512 (checkperms-1.12.tar.gz) = "+
                        "43e37b5963c63fdf716acdb470928d7e21a7bdfddd6c85cf626a11acc7f45fa5"+
                        "2a53d4bcd83d543150328fe8cec5587987d2d9a7c5f0aaeb02ac1127ab41f8ae",
@@ -242,7 +241,7 @@ func (s *Suite) Test_Pkglint_Main__compl
                        "This package should be updated to 1.13 (supports more file formats; see ../../doc/TODO:5).",
                "ERROR: ~/sysutils/checkperms/Makefile:4: Invalid category \"tools\".",
                "ERROR: ~/sysutils/checkperms/TODO: Packages in main pkgsrc must not have a TODO file.",
-               "ERROR: ~/sysutils/checkperms/distinfo:7: SHA1 hash of patches/patch-checkperms.c differs "+
+               "ERROR: ~/sysutils/checkperms/distinfo:6: SHA1 hash of patches/patch-checkperms.c differs "+
                        "(distinfo has asdfasdf, patch file has bcfb79696cb6bf4d2222a6d78a530e11bf1c0cea).",
                "WARN: ~/sysutils/checkperms/patches/patch-checkperms.c:12: Premature end of patch hunk "+
                        "(expected 1 lines to be deleted and 0 lines to be added).",



Home | Main Index | Thread Index | Old Index