aconfmgr icon indicating copy to clipboard operation
aconfmgr copied to clipboard

Allow adding / installing packages with `--asdeps`

Open funketh opened this issue 4 years ago • 5 comments

pacman allows you to install packages with the option --asdeps to mark them as dependencies. This is useful for optional dependencies as pacman can then recognize them as orphans when the packages that optionally required them are removed. Supporting this flag might also help with the limitations mentioned in the README.

funketh avatar Sep 24 '19 11:09 funketh

Let's assume hypothetically that AddPackage --asdeps is added to aconfmgr, and you add a package in that way to your configuration.

  • What do you expect to happen when you run aconfmgr apply, and that package is not installed on the system, nor is it required by any other package in your configuration?

  • What do you expect to happen when you run aconfmgr apply, and that package is installed on the system, but it is not required by any other package in your configuration?

CyberShadow avatar Sep 24 '19 21:09 CyberShadow

Well I think that for consistency's sake there are two options:

  • install/keep
  • don't install/remove

Either way, you should get a warning. Removing/not installing the package seems to be the better solution because the package shouldn't have a purpose and is therefore a mistake in the configuration. If the user needs the package even though no packages depend on it then that package is not a dependency and should be explicitly installed.

funketh avatar Sep 25 '19 05:09 funketh

I'd like this - aconfmgr doing something sensible with it would actually make --asdeps more useful to me than it is today.

OJFord avatar May 30 '20 19:05 OJFord

I think this makes sense on paper, but it would make certain aspects of aconfmgr's implementation much more complicated.

For now, I suggest a pragmatic approach: place each instance of such a dependency beneath its main package in the configuration file (along with said package's other configuration). When you no longer need the main package, you would also remove the dependency.

It is valid to specify a package more than once, so the dependency can be specified as often as necessary.

CyberShadow avatar Nov 22 '21 21:11 CyberShadow