ibrewster / homebrew-avo

AVO related homebrew formulas
3 stars 2 forks source link

SHA 256 mismatch when installing `hourssince` #7

Closed jwbishop closed 4 years ago

jwbishop commented 4 years ago

When attempting to install hourssince, a SHA256 mismatch error occurs.

==> Installing hourssince from ibrewster/avo ==> Downloading https://github.com/usgs/volcano-ash3d-hourssince/archive/master.tar.gz ==> Downloading from https://codeload.github.com/usgs/volcano-ash3d-hourssince/tar.gz/master ######################################################################## 100.0% Error: SHA256 mismatch Expected: 56e42abc1431239b1b772f8e6eee6d43386b114d2e00400548e9ff9a58dfcaf3 Actual: 2a4b1fb6e872ac49e45ccef7758186c8b78c64e71e58cc8dd23dea610ef43793

liamtoney commented 4 years ago

This is likely because hourssince has been updated since @ibrewster last edited this formula.

https://github.com/usgs/volcano-ash3d-hourssince (last commit 13 days ago)

ibrewster commented 4 years ago

Homebrew formula updated, but with one small caveat: even with the version changed, homebrew thinks the download is the same, so if you try to update it will use any previously cached download and so fail. In that eventuality, the old cached download (as listed in the error message output) needs to be manually removed, whereupon it will download the new version and work properly.

liamtoney commented 4 years ago

Hmm. Trying to understand this. So what command would fail? brew upgrade hourssince ?

ibrewster commented 4 years ago

Hmm. Trying to understand this. So what command would fail? brew upgrade hourssince ?

Exactly. When trying to upgrade, if you have the old version downloaded, homebrew thinks the file is already downloaded (since the download link didn't change), and will just try to use that old cached file. Of course, since I changed the sha hash in the formula to match the new file, you'll get the same SHA mismatch between the new formula and the old cached file that we were getting between the new file and the old formula.

Deleting the pre-existing cached copy forces homebrew to download "again", whereupon it gets the new version with the new SHA sum.

liamtoney commented 4 years ago

Okay, to delete the cache would brew cleanup work?

Alternatively, would brew install hourssince force this?

ibrewster commented 4 years ago

brew cleanup would probably work, although I have a vague memory that wants to say you have to pass some flag or another to get it to delete the caches. I'm not sure on the behavior of just doing an install - I suspect, however, you would run into the same issue: homebrew believing that the file is already downloaded.

I wonder how picky GitHub is about the URL? That is, I wonder if I could just add an arbitrary parameter like ?_=2.0 to the URL that I change each time (so homebrew thinks the file has changed), and still have it work? Might be something I could try for next time.