Solving progress not safe issue for api

Progress is not safe so for api its always nil and
code needs to take care of this
This commit is contained in:
Oliver Sauder
2016-11-25 16:25:09 +01:00
committed by Lorenzo Bolla
parent 1c7c07ace7
commit 25d7d7c037
2 changed files with 13 additions and 6 deletions
+7 -5
View File
@@ -550,12 +550,14 @@ func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly.
}
}
err = repo.packageList.Add(p)
if _, ok := err.(*PackageConflictError); ok {
if progress != nil {
progress.ColoredPrintf("@y[!]@| @!skipping package %s: duplicate in packages index@|", p)
if err != nil {
if _, ok := err.(*PackageConflictError); ok {
if progress != nil {
progress.ColoredPrintf("@y[!]@| @!skipping package %s: duplicate in packages index@|", p)
}
} else if err != nil {
return err
}
} else if err != nil {
return err
}
}