opi icon indicating copy to clipboard operation
opi copied to clipboard

Possible change to install_package function

Open giovcandido opened this issue 2 years ago • 3 comments

One thing that could be interesting is to make the function install_package return a boolean value. When the installation is canceled by the user (by pressing 'n' instead of 'y' or enter), you can return without asking to keep the repo. If you guys think it is interesting enough, I can help the solution.

giovcandido avatar Aug 20 '21 12:08 giovcandido

One one side that could be faster in some situations but on the other side a user could want to remove the repo when he aborted the installation. So I would rather keep it.

asdil12 avatar Aug 20 '21 12:08 asdil12

Thinking this way, it makes sense. I made the suggestion because I thought that the default behavior when a user canceled the installation was not to keep the repo. If that was the case, we would have to check if repo is already stored as a source before creating it again. I mean, if the user has the repo because of a package they installed in the past and he is presented with the option to keep it or not, he may not know that it would affect the updates of existing packages.

giovcandido avatar Aug 20 '21 13:08 giovcandido

Note that in the meantime we do check if a repo already exists, before creating it, by comparing the url

asdil12 avatar Jun 03 '23 00:06 asdil12