FS#44957 - optdepends do not care for versions

Attached to Project: Pacman
Opened by Dominik Fischer (XZS) - Wednesday, 13 May 2015, 20:55 GMT
Last edited by Allan McRae (Allan) - Wednesday, 02 March 2016, 04:09 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 4.2.1
Due in Version 5.1.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Optional dependencies, specified through the optdepends array in a PKGBUILD, can contain version restrictions like any dependency. Pacman ignores these completely, only caring for whether a package is installed or not, regardless of its version.

The attached PKGBUILD creates two packages, named "dependency" and "dependent". The latter optionally depends on dependency>2, which is not available as both have version 1-1.

Installing both, pacman notes:
(1/2) installing dependancy [########################################################################################] 100%
(2/2) installing dependent [########################################################################################] 100%
Optional dependencies for dependent
dependency>=2: for testing [installed]
which is wrong as dependency is not installed in a version greater or equal 2.

Querying the package database also erroneously reports this.
$ pacman -Qi dependent
[...]
Optional Deps : dependency>=2: for testing [installed]
[...]

Lastly, the warning when when removing dependency also reports so.
$ pacman -R dependent
checking dependencies...
:: dependent optionally requires dependency>=2: for testing
pacman -Rs dependent also does not suggest to remove dependancy.

The behavior on removal may be intentional, but the former two should clearly not denote that the dependency is [installed] as the required version is not provided.
   PKGBUILD (0.2 KiB)
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 02 March 2016, 04:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit 3da06c35
Comment by Allan McRae (Allan) - Sunday, 21 February 2016, 06:48 GMT

Loading...