ninxsoft / mist-cli

A Mac command-line tool that automatically downloads macOS Firmwares / Installers.
MIT License
620 stars 29 forks source link

Mist thinks 11.6.1 RC is a production release. #40

Closed PicoMitchell closed 3 years ago

PicoMitchell commented 3 years ago

Because of how Mist uses a default catalog url that includes betas (which is awesome in general!), it is mistaking the 11.6.1 RC for a production release when running a command like mist download --image 'Big Sur' since it is it not marked as a beta in its name in the list.

Not sure about the best approach to solving this since I think it's generally convenient to list betas by default, but maybe Mist should add the catalog/seed source name as a column and have some simple way to only download Big Sur from the production catalog within a command?

I see there is already a way to pass a specific catalog url, but that feels overly cumbersome vs being able to choose the catalog by name such as Production vs Developer (the way that MDS makes this switching catalog sources convenient).

mist-11 6 1-rc
PicoMitchell commented 3 years ago

EDIT: THE FOLLOWING STATEMENTS ARE INCORRECT

Looking at this more closely, Mist uses https://swscan.apple.com/content/catalogs/others/index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz as the default catalog URL (which includes betas) while installinstallmacos.py uses https://swscan.apple.com/content/catalogs/others/index-11-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz (which does NOT include betas).

Odd that the only difference is 10.16 vs 11 in the URL, but they appear to load different data and the latter seems to only includes production releases.

For now, I will be using mist list -c 'https://swscan.apple.com/content/catalogs/others/index-11-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz' to ensure I'm only getting production releases for Big Sur and Monterey (once it's released).

Another thing I noticed with Mist is that when using this catalog URL, I see 3 "The data couldn’t be read because it isn’t in the correct format." entries under the "SEARCH" section, but the data seems to load just fine.

PicoMitchell commented 3 years ago

My bad, the different catalog URLs is not the issue!

I think that https://swscan.apple.com/content/catalogs/others/index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz is the correct production catalog URL to be using (and now https://swscan.apple.com/content/catalogs/others/index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz for Monterey).

The issue is that Mist is always trying to include all seed URLs in the list output: https://github.com/ninxsoft/Mist/blob/21b90e11c17c1f635dd9580fa895d89b0f68da26/Mist/Helpers/HTTP.swift#L104

When I changed the catalog URL to https://swscan.apple.com/content/catalogs/others/index-11-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz the code to generate the seed URLs was simply making invalid URLs and not showing me any betas (which is the cause of the "The data couldn’t be read because it isn’t in the correct format." errors).

So, in the end, I think that maybe Mist should just add an option as to whether or not the seed catalog URLs should be added into the list, and I don't think it would be best to have that done by default.

PicoMitchell commented 3 years ago

Thinking something like a -b/--include-betas option (or something like that) could make sense to add to mist list and mist download

ninxsoft commented 3 years ago

Thanks @PicoMitchell for looking into this!

I like the idea of having a -b / --include-betas flag (set to false by default), which will help separate out non-beta releases.

I also have some over-complicated logic for the catalog URLs, I am in favour of replacing the current logic with the following hardcoded values:

standard: https://swscan.apple.com/content/catalogs/others/index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz customer: https://swscan.apple.com/content/catalogs/others/index-12customerseed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz developer: https://swscan.apple.com/content/catalogs/others/index-12seed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz public: https://swscan.apple.com/content/catalogs/others/index-12beta-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz

PicoMitchell commented 3 years ago

Thank you! Looking forward to playing with this update tomorrow!