summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/patches.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkglint/files/patches.go')
-rw-r--r--pkgtools/pkglint/files/patches.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgtools/pkglint/files/patches.go b/pkgtools/pkglint/files/patches.go
index 7d871486f4c..c0c8d0b1885 100644
--- a/pkgtools/pkglint/files/patches.go
+++ b/pkgtools/pkglint/files/patches.go
@@ -4,8 +4,8 @@ package pkglint
import "strings"
-func CheckLinesPatch(lines *Lines) {
- (&PatchChecker{lines, NewLinesLexer(lines), false, false}).Check()
+func CheckLinesPatch(lines *Lines, pkg *Package) {
+ (&PatchChecker{lines, NewLinesLexer(lines), false, false}).Check(pkg)
}
type PatchChecker struct {
@@ -21,7 +21,7 @@ const (
rePatchUniHunk = `^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$`
)
-func (ck *PatchChecker) Check() {
+func (ck *PatchChecker) Check(pkg *Package) {
if ck.lines.CheckCvsID(0, ``, "") {
ck.llex.Skip()
}
@@ -84,10 +84,10 @@ func (ck *PatchChecker) Check() {
CheckLinesTrailingEmptyLines(ck.lines)
sha1Before := computePatchSha1Hex(ck.lines)
- if SaveAutofixChanges(ck.lines) && G.Pkg != nil {
+ if SaveAutofixChanges(ck.lines) && pkg != nil {
linesAfter := Load(ck.lines.Filename, 0)
sha1After := computePatchSha1Hex(linesAfter)
- G.Pkg.AutofixDistinfo(sha1Before, sha1After)
+ pkg.AutofixDistinfo(sha1Before, sha1After)
}
}