archlinux / asp

Arch Build Source Management Tool
MIT License
294 stars 34 forks source link

fix possibility of corrupt caches #20

Closed polygamma closed 6 years ago

polygamma commented 7 years ago

Bug: It is possible to get corrupt caches. Steps to reproduce:

rm -rf ~/.cache/asp Disconnect from the internet. Try to export a package, for example: asp export asp ---Exporting fails, which is fine, since we are not connected to the internet--- Now connect to the internet again. Try to export a package, again: asp export asp --- Exporting still fails, which should not happen---

Simple if, which prevents generating corrupt caches fixes the problem.

falconindy commented 6 years ago

Thanks for the bug report -- I'm committing a slightly different approach which gets rid of the tempfile entirely. See 22f079869b7586bcef4b77b6601376be2bd1e61d.