Skip to content

Commit

Permalink
Allow duplicate DESCR files in main/wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Jan 19, 2024
1 parent 486dfa6 commit 0eaeae1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions v23/pkglint.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,12 +940,20 @@ func (ip *InterPackage) CheckDuplicateDescr(filename CurrPath) {
h := sha1.Sum(b)
existing := descr[h]
descr[h] = append(existing, filename)
if len(existing) == 0 {
var duplicate CurrPath
for _, e := range existing {
if e.Dir().Base() == filename.Dir().Base() &&
G.Pkgsrc.IsWip(filename) != G.Pkgsrc.IsWip(e) {
continue
}
duplicate = e
}
if duplicate.IsEmpty() {
return
}
line := NewLineWhole(filename)
line.Warnf("DESCR file is the same as %q.",
line.Rel(existing[len(existing)-1]))
line.Rel(duplicate))
line.Explain(
"Each DESCR file should be unique,",
"to help the user choose the most appropriate package.",
Expand Down

0 comments on commit 0eaeae1

Please sign in to comment.