mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-17 06:29:21 -04:00
Currently the install command requires the user to specify the remote name in addition to each ref that is to be installed. This commit implements an auto-detection feature so that the user can specify only refs (or partial refs) and Flatpak will try to determine the remote to use. The Flatpak security model does not consider all remotes equally trustworthy, but that's okay because the user is asked to confirm the remote choice before it's used. The way it's implemented is that we look at only the first ref (even if there are several) and iterate through each remote in each installation trying to find it, stopping at the first one where it's found and asking for confirmation of it. There's a trade-off here between efficiency and accuracy, since it could be pretty costly to search every remote in every installation. I think this should be good enough for most use cases, and the user is still free to specify a remote and avoid that code path. This should hopefully save people a bit of typing and make the Flatpak CLI a bit friendlier. Closes: #2113 Approved by: matthiasclasen