diff options
author | rillig <rillig@pkgsrc.org> | 2016-12-04 15:28:36 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2016-12-04 15:28:36 +0000 |
commit | ca7b482c61f58bd7cef0e8e6f5bee301414300af (patch) | |
tree | ed09b2e8fb345da1d55de80b2035ebd46a96b722 /pkgtools/pkglint/files/distinfo.go | |
parent | c2caec9fd1882a25821a73eba14a9d1553689250 (diff) | |
download | pkgsrc-ca7b482c61f58bd7cef0e8e6f5bee301414300af.tar.gz |
Updated pkglint to 5.4.12.
Changes since 5.4.11:
* warn when PKGSRC_COMPILER is compared with "==", since it may be a chain
of compilers
* warn about listing Python .egg-info files directly in PLIST files, since
lang/python/egg.mk takes care of this
* code cleanup: unify Error{0,1,2,3} into Errorf to make understanding the
code easier; use interface{} for MkLine data; use regular expression
instead of handwritten matching code, since one line is easier to read
than 50
Diffstat (limited to 'pkgtools/pkglint/files/distinfo.go')
-rw-r--r-- | pkgtools/pkglint/files/distinfo.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkgtools/pkglint/files/distinfo.go b/pkgtools/pkglint/files/distinfo.go index 6d026f9ca45..18e0917ed12 100644 --- a/pkgtools/pkglint/files/distinfo.go +++ b/pkgtools/pkglint/files/distinfo.go @@ -48,7 +48,7 @@ type distinfoLinesChecker struct { func (ck *distinfoLinesChecker) checkLines(lines []*Line) { lines[0].CheckRcsid(``, "") if 1 < len(lines) && lines[1].Text != "" { - lines[1].Note0("Empty line expected.") + lines[1].Notef("Empty line expected.") } for i, line := range lines { @@ -57,7 +57,7 @@ func (ck *distinfoLinesChecker) checkLines(lines []*Line) { } m, alg, filename, hash := match3(line.Text, `^(\w+) \((\w[^)]*)\) = (.*)(?: bytes)?$`) if !m { - line.Error0("Invalid line.") + line.Errorf("Invalid line.") continue } @@ -78,10 +78,10 @@ func (ck *distinfoLinesChecker) onFilenameChange(line *Line, nextFname string) { algorithms := strings.Join(ck.algorithms, ", ") if ck.isPatch { if algorithms != "SHA1" { - line.Error2("Expected SHA1 hash for %s, got %s.", currentFname, algorithms) + line.Errorf("Expected SHA1 hash for %s, got %s.", currentFname, algorithms) } } else if hasPrefix(currentFname, "patch-") && algorithms == "SHA1" { - ck.currentFirstLine.Warn2("Patch file %q does not exist in directory %q.", currentFname, cleanpath(ck.patchdir)) + ck.currentFirstLine.Warnf("Patch file %q does not exist in directory %q.", currentFname, cleanpath(ck.patchdir)) Explain( "If the patches directory looks correct, the patch may have been", "removed without updating the distinfo file. In such a case please", @@ -89,7 +89,7 @@ func (ck *distinfoLinesChecker) onFilenameChange(line *Line, nextFname string) { "", "If the patches directory looks wrong, pkglint needs to be improved.") } else if algorithms != "SHA1, RMD160, Size" && algorithms != "SHA1, RMD160, SHA512, Size" { - line.Error2("Expected SHA1, RMD160, SHA512, Size checksums for %q, got %s.", currentFname, algorithms) + line.Errorf("Expected SHA1, RMD160, SHA512, Size checksums for %q, got %s.", currentFname, algorithms) } } @@ -102,7 +102,7 @@ func (ck *distinfoLinesChecker) onFilenameChange(line *Line, nextFname string) { func (ck *distinfoLinesChecker) checkPatchSha1(line *Line, patchFname, distinfoSha1Hex string) { patchBytes, err := ioutil.ReadFile(G.CurrentDir + "/" + patchFname) if err != nil { - line.Error1("%s does not exist.", patchFname) + line.Errorf("%s does not exist.", patchFname) return } @@ -158,7 +158,7 @@ func (ck *distinfoLinesChecker) checkUncommittedPatch(line *Line, patchName, sha if ck.isPatch { patchFname := ck.patchdir + "/" + patchName if ck.distinfoIsCommitted && !isCommitted(G.CurrentDir+"/"+patchFname) { - line.Warn1("%s is registered in distinfo but not added to CVS.", patchFname) + line.Warnf("%s is registered in distinfo but not added to CVS.", patchFname) } ck.checkPatchSha1(line, patchFname, sha1Hash) ck.patches[patchName] = true |