Use PackageCollection when downloading remote repo.

This commit is contained in:
Andrey Smirnov
2013-12-23 14:14:17 +04:00
parent 65063135c9
commit fe61ae1b41
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -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)
}
+2 -2
View File
@@ -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