mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-29 01:51:20 -05:00
Currently if the user doesn't specify a remote name to the install command, Flatpak chooses the first one that has a matching ref, either with or without user interaction depending on whether --assumeyes/-y was used. Then if more than one remote ref is similar to the one specified, the user is prompted to choose between them. I think this asymmetry doesn't make much sense; why not have the user choose between remotes just as they choose between refs? For example, the string "libre" matches refs from both flathub and eos-apps, so if I do "flatpak install -y libre" a remote is arbitrarily chosen for me but I'm still prompted to choose between the refs (since -y can't choose for you when there are mutliple choices). So this commit changes the install command implementation to present the user with a list of remotes that have matching refs all at once rather than one at a time. The reason I didn't implement it this way at first is that I was worried about the performance impact, but in testing I'm not able to measure a difference between stopping at the first remote with a match and checking every remote (although the story might be different if you have many remotes or don't have up-to-date metadata downloaded). If there's an error searching a remote, it's treated as a warning so that one misconfigured remote doesn't take down the whole operation with it. This commit also updates the unit tests so they continue to succeed. Closes: #2288 Approved by: matthiasclasen