mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-21 10:58:23 +00:00
When loading package index for the mirror, ignore duplicate packages (and print about them). #183
This commit is contained in:
1 parent
0412646151
commit
403c7272cd
2 files changed
+11
-2
No files matched your search
+6
-1
@@ -38,6 +38,11 @@ type PackageList struct {
|
||||
providesIndex map[string][]*Package
|
||||
}
|
||||
|
||||
// PackageConflictError means that package can't be added to the list due to error
|
||||
type PackageConflictError struct {
|
||||
error
|
||||
}
|
||||
|
||||
// Verify interface
|
||||
var (
|
||||
_ sort.Interface = &PackageList{}
|
||||
@@ -90,7 +95,7 @@ func (l *PackageList) Add(p *Package) error {
|
||||
existing, ok := l.packages[key]
|
||||
if ok {
|
||||
if !existing.Equals(p) {
|
||||
return fmt.Errorf("conflict in package %s", p)
|
||||
return &PackageConflictError{fmt.Errorf("conflict in package %s", p)}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user