obb

borkdude 2022-03-09T09:40:03.332119Z

obb v0.0.3 released. https://github.com/babashka/obb/blob/main/CHANGELOG.md#003---2022-03-09

danieroux 2022-03-09T12:45:01.104879Z

command-line-args works, and my obb script is making me very happy. Thank you @zane and@borkdude!

πŸ‘πŸ» 1
borkdude 2022-03-09T12:48:38.667619Z

πŸ‘

ordnungswidrig 2022-03-09T16:21:35.974529Z

I get a SHA mismatch for obb v0.0.3 when upgrading via brew.

ordnungswidrig 2022-03-10T08:36:46.614899Z

user=> (format "%064x", (BigInteger. "cafebabe123" 16))
"00000000000000000000000000000000000000000000000000000cafebabe123"

πŸ‘ 1
borkdude 2022-03-10T08:40:37.119699Z

Thanks :)

ordnungswidrig 2022-03-09T16:22:49.525539Z

❯ brew upgrade
==> Upgrading 2 outdated packages:
babashka/brew/obb 0.0.2 -> 0.0.3
graphviz 2.50.0 -> 3.0.0
==> Downloading 
Already downloaded: /Users/philipp.meier/Library/Caches/Homebrew/downloads/32ab0db39c2cffc5046614247fa805bbba9947f9ed68b8b109fd309dfeed9aad--obb.tar.gz
Error: SHA256 mismatch
Expected: 79b6855082ab0b6bef829a4d7688dbf679c0ee832dd2e7a5bd50c177114178c9
  Actual: 0564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731
    File: /Users/philipp.meier/Library/Caches/Homebrew/downloads/32ab0db39c2cffc5046614247fa805bbba9947f9ed68b8b109fd309dfeed9aad--obb.tar.gz
To retry an incomplete download, remove the file above.

borkdude 2022-03-09T16:24:23.900069Z

sorry

borkdude 2022-03-09T16:24:27.133889Z

please try again

ordnungswidrig 2022-03-09T16:44:46.162239Z

Close, but no cigar

ordnungswidrig 2022-03-09T16:44:51.231499Z

Expected: 564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731
  Actual: 0564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731

borkdude 2022-03-09T16:46:37.651179Z

Can you make sure to purge your local brew recipes

borkdude 2022-03-09T16:46:59.355789Z

I pushed a new one but you gotta clear your local one

borkdude 2022-03-09T16:47:29.373549Z

The sha-1 in the formula is now: "564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731"

borkdude 2022-03-09T17:01:43.009399Z

maybe removing and re-installing will help

lread 2022-03-09T17:50:51.227549Z

Tried uninstalling, but still having issues:

brew install babashka/brew/obb                                                                                              
==> Downloading 
==> Downloading from 
######################################################################## 100.0%
Error: obb: SHA256 mismatch
Expected: 564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731
  Actual: 0564ffc2038300fef50e074b9cd4a3fa7c426817989691c531b4032180afd731
    File: /Users/lee/Library/Caches/Homebrew/downloads/32ab0db39c2cffc5046614247fa805bbba9947f9ed68b8b109fd309dfeed9aad--obb.tar.gz
To retry an incomplete download, remove the file above.

lread 2022-03-09T17:51:03.800159Z

That extra leading zero seems suspect!

borkdude 2022-03-09T18:00:46.488089Z

fuck, indeed

lread 2022-03-09T18:01:10.923159Z

simple_smile

borkdude 2022-03-09T18:03:07.694539Z

can you maybe take a look in https://github.com/babashka/homebrew-brew, if you want? I'm having dinner. The bb update-obb task creates the recipe. I'll be back in a hour...

lread 2022-03-09T18:15:52.997809Z

sure, I’ll take a peek

borkdude 2022-03-09T18:26:55.768809Z

but why are they needed by brew :(

borkdude 2022-03-09T18:27:16.247679Z

should we format the string using leading zeroes using format ?

lread 2022-03-09T18:28:06.925729Z

Ya I think that would do the trick…

lread 2022-03-09T18:29:22.286199Z

… %02x?

borkdude 2022-03-09T18:33:45.159619Z

fixed it by shelling out to sha256sum

lread 2022-03-09T18:33:54.150839Z

I guess maybe a sha256 is 256 bits which means it is always 64 characters long?

borkdude 2022-03-09T18:34:16.017439Z

please try installing again

lread 2022-03-09T18:35:03.157299Z

$ obb --version
obb v0.0.3

lread 2022-03-09T18:35:08.800399Z

success!

borkdude 2022-03-09T18:35:14.977899Z

πŸŽ‰

πŸŽ‰ 1
borkdude 2022-03-09T18:42:17.762229Z

ok, the fixed hex fn:

(defn ->hex [file]
                   (let [digest (java.security.MessageDigest/getInstance "SHA-256")
                         hash (.digest digest (fs/read-all-bytes file))
                         hex (.toString (BigInteger. 1 hash) 16)
                         zeroes (str/join (repeat (- 64 (count hex)) "0"))
                         hex (str zeroes hex)]
                     hex)))

borkdude 2022-03-09T18:42:32.649509Z

at least I don't have to worry about linux/mac this way

lread 2022-03-09T18:44:08.701919Z

ya that works, and no wondering about how format might behave.