Repository navigation
Conversation
|
Thanks! Looks good on quick readthrough. I'm cool to merge this as part of other HBAS updates; we can check for platform compatibility bugs as part of on-device testing for next HBAS release and backport changes if necessary. @vgmoose your call. |
|
I'm actually a little cagey on this just because of how file streams and rename operations work (or, don't work) on homebrew platforms. Can we accomplish something similar without a tmp file first? |
efc11cb to
9b6ae07
Compare
|
I finally had a chance to look more into this. The rename was a real problem because libfat and libnx don't replace an existing file, so every save after the first would fail. I took the tmp file out and saveRepos writes repos.json directly again. What actually breaks in #163 is a repos.json full of NUL bytes (what FAT tends to leave after a power cut). main stays stuck with zero repos there. The load side now moves it to .bad and writes the default. Added a test for that. |
Fixes fortheusers/hb-appstore#163. A repos.json full of NUL bytes left libget without any repos for good. Now it gets kept as repos.json.bad and the default is written again. saveRepos writes the file directly and syncs it, without a tmp file or rename.