summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkglint/files/util.go')
-rw-r--r--pkgtools/pkglint/files/util.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/util.go b/pkgtools/pkglint/files/util.go
index 478943ae2aa..1ea5f6315b7 100644
--- a/pkgtools/pkglint/files/util.go
+++ b/pkgtools/pkglint/files/util.go
@@ -568,7 +568,7 @@ func naturalLess(str1, str2 string) bool {
// like defining PKGNAME, then evaluating it using :=, then defining it again.
// This pattern is so error-prone that it should not appear in pkgsrc at all,
// thus pkglint doesn't even expect it. (Well, except for the PKGNAME case,
-// but that's deep in the infrastructure and only affects the "nb13" extension.
+// but that's deep in the infrastructure and only affects the "nb13" extension.)
type RedundantScope struct {
vars map[string]*redundantScopeVarinfo
condLevel int
@@ -610,6 +610,9 @@ func (s *RedundantScope) Handle(mkline MkLine) {
s.vars[varname] = &redundantScopeVarinfo{mkline, value}
}
} else if existing != nil {
+ if op == opAssign && existing.value == value {
+ op = opAssignDefault
+ }
switch op {
case opAssign:
if s.OnOverwrite != nil {