[pacman-dev] A possible way to improve pacman's provision selection

Nagy Gabor ngaba at bibl.u-szeged.hu
Wed Sep 16 09:09:11 EDT 2009


Hi!

This discussion is motivated by FS#16117.
First of all, I know that "pacman -Sy foo" is not recommended, only
"pacman -Syu foo" (see commit f53d9ba), but it is still allowed by
pacman (which is distro independent), so I must mention the following
situation:

---sync405.py---
self.description = "Choice between provider and literal"

sp1 = pmpkg("pkg")
sp1.depends = ["dep>=2.0"]
self.addpkg2db("sync", sp1)

sp2 = pmpkg("dep", "2.0-1")
self.addpkg2db("sync", sp2)

sp3 = pmpkg("dep-ng", "2.0-1")
sp3.provides = ["dep=2.0"]
sp3.conflicts = ["dep"]
self.addpkg2db("sync", sp3)

lp = pmpkg("dep-ng")
lp.provides = ["dep"]
lp.conflicts = ["dep"]
self.addpkg2db("local", lp)

self.args = "-S pkg"

self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg")
self.addrule("!PKG_EXIST=dep")
self.addrule("PKG_EXIST=dep-ng")
self.addrule("PKG_VERSION=dep-ng|2.0-1")

self.expectfailure = True
----------------

In this case we should clearly choose dep-ng dependency satisfier,
because it has an older version installed. Unfortunately "computing all
satisfiers then choosing" is much slower then "search for literal" (if
provisions are not needed), so speed is a show-stopper here atm (like
with FS#15500).

Bye




More information about the pacman-dev mailing list