mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-17 19:08:13 +00:00
We should remove file only when checksums are calculated
This commit is contained in:
@@ -336,10 +336,6 @@ func (pool *PackagePool) Import(srcPath, basename string, checksums *utils.Check
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil && move {
|
||||
err = os.Remove(srcPath)
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
if !checksums.Complete() {
|
||||
// need full checksums here
|
||||
@@ -352,6 +348,10 @@ func (pool *PackagePool) Import(srcPath, basename string, checksums *utils.Check
|
||||
err = checksumStorage.Update(poolPath, checksums)
|
||||
}
|
||||
|
||||
if err == nil && move {
|
||||
err = os.Remove(srcPath)
|
||||
}
|
||||
|
||||
return poolPath, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user