Gemba / skyscraper

Powerful and versatile game data scraper written in Qt and C++.
https://gemba.github.io/skyscraper/
GNU General Public License v3.0
54 stars 14 forks source link

fix: amend sed when wget response for version is on single line #78

Closed boxart-buddy closed 4 months ago

boxart-buddy commented 4 months ago

Bit of a weird one here but will try to explain.

I had a report from a user on Fedora 40 who was trying to install Skyscraper and was running into an issue:

Trying to install Skyscraper using the instructions provided they have the following output:

--- Fetching Skyscraper v* Various community suggestions implemented\r\n* All details [here](https://gemba.github.io/skyscraper/CHANGELOG/#version-3120-2024-07-01) ---
0 files              100% [=================================================================>]  118.61K    --.-KB/s
                          [Files: 0  Bytes: 118.61K [344.81KB/s] Redirects: 0  Todo: 0  Error]
--- Failed to fetch Skyscraper v* Various community suggestions implemented\r\n* All details [here](https://gemba.github.io/skyscraper/CHANGELOG/#version-3120-2024-07-01), exiting with code 8 ---

I downloaded a Fedora40 Image and was able to reproduce the issue.

What's happening is that the line which is fetching the current version from the github release API isn't working as expected. The root cause is that the 'wget' command here, instead of returning the json response 'pretty printed' with line breaks is instead returning the response on a single line. Consequentially the piped grep and sed commands are extracting the 'tag_name' incorrectly, which causes the subsequent download command to fail.

There are two possible reasons as far as I can work out:

1) wget on this system isn't parsing the 'pretty printed' response as expected and is compressing it onto a single line 2) wget is forming the request in such a way that the github API isn't responding with a pretty printed response

I've tested the Skyscraper install script on multiple Linux distros recently including Fedora28, Debian 12, Ubuntu 22 and macOS 14.5 and none of them have this behaviour, but it remains a fact that it seems to be happening with Fedora40 for whatever reason.

I spent a bit of time trying to work out why this was happening without making much progress before deciding that just changing the sed command to handle both types of response was less hassle.

As such the PR submitted will extract the version correctly from both 'pretty printed' json responses and also 'single line' json responses.

Gemba commented 4 months ago

Closing this as it is addressed with 54dfad5

boxart-buddy commented 4 months ago

Thanks