Fix bug with PoolPath field being overwritten on mirror update

While updating mirror, if package file is already in pool path,
field `PoolPath` was left as empty which results in package file
being unavailable later on while publishing.
This commit is contained in:
Andrey Smirnov
2017-08-11 20:05:55 +03:00
parent 587bfd742f
commit a584b2e058
7 changed files with 69 additions and 24 deletions
+6 -1
View File
@@ -27,7 +27,12 @@ type PackageFile struct {
// Verify that package file is present and correct
func (f *PackageFile) Verify(packagePool aptly.PackagePool, checksumStorage aptly.ChecksumStorage) (bool, error) {
return packagePool.Verify(f.PoolPath, f.Filename, &f.Checksums, checksumStorage)
generatedPoolPath, exists, err := packagePool.Verify(f.PoolPath, f.Filename, &f.Checksums, checksumStorage)
if exists && err == nil {
f.PoolPath = generatedPoolPath
}
return exists, err
}
// GetPoolPath returns path to the file in the pool