FS#53813 - [pacman] By default do not install an ignored package
Attached to Project:
Pacman
Opened by Filippo Squillace (feel) - Tuesday, 25 April 2017, 08:32 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 25 April 2017, 13:38 GMT
Opened by Filippo Squillace (feel) - Tuesday, 25 April 2017, 08:32 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 25 April 2017, 13:38 GMT
|
Details
Description:
In order to make automation easier, by default pacman should avoid installing ignored packages (with --ignore options). Currently, it seems there is not an easy way to ignore some packages from a package group. Additional info: * Pacman 5.0.1-5 Steps to reproduce: sudo pacman -S --noconfirm --ignore sudo base-devel :: sudo is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] .... .... .... |
This task depends upon
Personally, if I read something like: `pacman --ignore sudo ....` I naturally translates it as: "Whatever operation pacman will perform, ignore sudo package".
Even from an example without package groups like: `pacman --ignore sudo -S grep awk sudo` should ignore installing `sudo` package. This is particularly useful for building programs upon pacman when you do not know a priori the packages involved for the given operation.
As I did not know the actual option behavior (my bad, I should have read the pacman man better), more than a bug fix consider this as a potential feature.
This change might make your particular use easier, but it would come at the expense of other possible uses. For instance, how would a tool install/update an ignored package if we change this default?
```
#!/bin/bash
pacman --ignore sudo $@
```
The script will let to the user decide which packages to install/update, whereas it is the program to enforce that installation/upgrade of sudo package should not be allowed. Such option is truly useful for expressing the need of ignoring packages when performing any pacman operations. If that's not the case, it is just misleading IMHO.
In this way `--ignore` can be used in the circumstances:
- ignore a specific package in a package group
- ignore a package specified from cli (the example above)
for any pacman operation (install/upgrade for instance).
About: "For instance, how would a tool install/update an ignored package if we change this default?"
If a package is considered ignored, it means it is not supposed to be installed/updated by all means. In this case you just simply do not need to use `--ignore` at all.
Again, --ignore is not some "pretend I did not tell you to install this package even though I really did" flag; it prevents updates to installed packages. Updating an ignored package is not all that uncommon. It is used to prevent the automatic update of important packages, like the kernel, to allow the user to manually update them at more appropriate times by explicitly providing them.
In order to let the user still transparently use `pacman` command you need to ensure the user will not install `sudo` package by mistake.
With the solution I am providing this is feasible. In fact, you just need to change `/etc/pacman.conf` with the content:
IgnorePkg = sudo
In this way whatever the user will do on `sudo` package it cannot be installed.
With the current solution pacman has, pacman will sadly override `mysudo` package with `sudo` instead.
For this use case the solution you provided `pacman -Sgq base-devel | grep -Fvx sudo | sudo pacman -S -` cannot be useful as it enforces the user to explicitly ignore the `sudo` package.
Again, a quite misleading behavior IMHO.
I expressed the concerns but if you do not feel this task is so much valuable feel free to close this.
```
pacman -Syu --ignore sudo base-devel
...
<guess what???? it just ignores sudo and does not prompt!>
...
```
Whoever did it, a huge thanks to you!