mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Use PackageCollection when downloading remote repo.
This commit is contained in:
+3
-1
@@ -124,7 +124,9 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error {
|
||||
return fmt.Errorf("unable to update: %s", err)
|
||||
}
|
||||
|
||||
err = repo.Download(context.downloader, context.database, context.packageRepository)
|
||||
packageCollection := debian.NewPackageCollection(context.database)
|
||||
|
||||
err = repo.Download(context.downloader, packageCollection, context.packageRepository)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to update: %s", err)
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -151,7 +151,7 @@ func (repo *RemoteRepo) Fetch(d utils.Downloader) error {
|
||||
}
|
||||
|
||||
// Download downloads all repo files
|
||||
func (repo *RemoteRepo) Download(d utils.Downloader, db database.Storage, packageRepo *Repository) error {
|
||||
func (repo *RemoteRepo) Download(d utils.Downloader, packageCollection *PackageCollection, packageRepo *Repository) error {
|
||||
list := NewPackageList()
|
||||
|
||||
// Download and parse all Release files
|
||||
@@ -178,7 +178,7 @@ func (repo *RemoteRepo) Download(d utils.Downloader, db database.Storage, packag
|
||||
|
||||
// Save package meta information to DB
|
||||
list.ForEach(func(p *Package) {
|
||||
db.Put(p.Key(), p.Encode())
|
||||
packageCollection.Update(p)
|
||||
})
|
||||
|
||||
// Download all package files
|
||||
|
||||
Reference in New Issue
Block a user