mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +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 err == nil {
|
||||||
if !checksums.Complete() {
|
if !checksums.Complete() {
|
||||||
// need full checksums here
|
// need full checksums here
|
||||||
@@ -352,6 +348,10 @@ func (pool *PackagePool) Import(srcPath, basename string, checksums *utils.Check
|
|||||||
err = checksumStorage.Update(poolPath, checksums)
|
err = checksumStorage.Update(poolPath, checksums)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err == nil && move {
|
||||||
|
err = os.Remove(srcPath)
|
||||||
|
}
|
||||||
|
|
||||||
return poolPath, err
|
return poolPath, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user