mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
snapshot: explicity call FilterLatestRefs() where needed rather than calling from Merge()
This commit is contained in:
@@ -27,7 +27,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
if repo.RefList() != nil {
|
||||
existingPackageRefs = existingPackageRefs.Merge(repo.RefList(), false, false)
|
||||
existingPackageRefs = existingPackageRefs.Merge(repo.RefList(), false)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
@@ -41,7 +41,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
if repo.RefList() != nil {
|
||||
existingPackageRefs = existingPackageRefs.Merge(repo.RefList(), false, false)
|
||||
existingPackageRefs = existingPackageRefs.Merge(repo.RefList(), false)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
@@ -54,7 +54,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
existingPackageRefs = existingPackageRefs.Merge(snapshot.RefList(), false, false)
|
||||
existingPackageRefs = existingPackageRefs.Merge(snapshot.RefList(), false)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -29,15 +29,16 @@ func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
|
||||
latest := context.flags.Lookup("latest").Value.Get().(bool)
|
||||
overrideMatching := !latest
|
||||
|
||||
result := sources[0].RefList()
|
||||
|
||||
for i := 1; i < len(sources); i++ {
|
||||
if latest {
|
||||
result = result.Merge(sources[i].RefList(), false, true)
|
||||
} else {
|
||||
result = result.Merge(sources[i].RefList(), true, false)
|
||||
}
|
||||
result = result.Merge(sources[i].RefList(), overrideMatching)
|
||||
}
|
||||
|
||||
if latest {
|
||||
result = deb.FilterLatestRefs(result)
|
||||
}
|
||||
|
||||
sourceDescription := make([]string, len(sources))
|
||||
|
||||
Reference in New Issue
Block a user