You are not logged in.

#1 2022-06-02 20:41:45

Indecisive
Member
Registered: 2021-03-19
Posts: 5

Would pacman accept these OptDepends additions?

Currently, optional dependencies may either be installed explicitly, which has the disadvantage of

pacman -Rns package_A

not removing optional dependencies if package_A is the only package requiring them, or installed as dependencies, which has the disadvantage of

pacman -Rns package_B

potentially uninstalling package_A optional dependencies, if package_A has optional dependencies that are also package_B dependencies.

This makes certain commands such as

pacman -Qtdq | pacman -Rns - 

potentially remove optional dependencies, even though a user's intuition may not expect this.


Several years ago, a user posted a list of improvements for pacman that they were trying to implement here on the ArchWiki. While some of these improvements seem to have been implemented upstream, certain behaviors like this (where tk is an optional dependency for python and git):

> pacman -Rs git
checking dependencies...

Remove (1): git-1.7.6-1

> pacman -Rs git python
checking dependencies...

Remove (3): git-1.7.6-1 python-3.2.1-1 tk-8.5.10-1

have not been implemented. Nor has his suggested --optdeps flag (nor an inverse --no-optdeps) been implemented either.


Is there an explicit reason for this feature not being included, or is it simply a lack of contribution? If another user contributed this feature to upstream, would it be accepted?

Offline

#2 2022-06-02 22:02:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Would pacman accept these OptDepends additions?

Indecisive wrote:

... or installed as dependencies, which has the disadvantage of

pacman -Rns package_B

potentially uninstalling package_A optional dependencies, if package_A has optional dependencies that are also package_B dependencies.

This makes certain commands such as

pacman -Qtdq | pacman -Rns - 

potentially remove optional dependencies

Neither of these statements are true.  The second would be true if two 't' flags were given to the first call to pacman, but not with just one.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-06-02 23:27:43

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Would pacman accept these OptDepends additions?

Actually, both those statements are true...   Potentially could be explained more clearly, but are correct.


Anyway, the user who wrote that wiki page was me, who also happens to be the pacman lead developer!  The answer as to whether I would accept patches to implement whatever I wrote many years ago is "possibly", and there reason they were not implemented at the time is other priorities.

I'd suggest discussing exactly what you want to implement on the pacman-dev mailing list before going ahead and coding.

Offline

#4 2022-06-02 23:32:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Would pacman accept these OptDepends additions?

How are they true?

man pacman (emphasis added) wrote:

-t, --unrequired                                                                                                             
    Restrict or filter output to print only packages neither required nor optionally required by any currently installed package.

So `pacman -Qdtq` will not list packages that are optional dependencies of installed packages, and so when the resulting list is removed, no optially dependent packages will be removed.  Therefore, the statement is false.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-06-03 01:09:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Would pacman accept these OptDepends additions?

pkgA optionally requires pkgZ.   pkgB depends on pkgZ and is not installed explicitly.   `pacman -Qqtd` will list pkgB and `pacman -Rs pkgB` will remove pkgZ.

Offline

#6 2022-06-03 01:14:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Would pacman accept these OptDepends additions?

Ah - thanks for the clarification.  I guess I've never face that situation.

Sorry for the noise.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB