mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-15 10:07:24 +00:00
We should remove file only when checksums are calculated
This commit is contained in:
1 parent
5dd11a2ec2
commit
8078f3b588
1 file changed
+4
-4
@@ -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