mvdan / fdroidcl

F-Droid desktop client
BSD 3-Clause "New" or "Revised" License
263 stars 22 forks source link

Upgrade command reports sha256 mismatch on download failure #3

Closed relan closed 8 years ago

relan commented 8 years ago

Due to wrong SELinux attributes, downloading of an APK was failing with HTTP 403 error. Instead of reporting the error, fdroidcl silently creates a zero-sized file in ~/.cache/fdroidcl/apks/ and then fails on SHA-256 check:

$ fdroidcl update
Downloading https://f-droid.org/repo/index.jar... not modified
Downloading https://f-droid.org/archive/index.jar... not modified
Downloading http://localhost/fdroid/repo/index.jar... not modified
$ fdroidcl upgrade org.gnu.icecat
Downloading http://localhost/fdroid/repo/icecatmobile-38.6.0.en-US.android-arm.apk... 
2016/02/14 21:40:23 Could not download org.gnu.icecat: sha256 mismatch

Looks like HTTP reply code check is missing.

mvdan commented 8 years ago

Thanks for reporting!