[pacman-dev] some pacman work

Xavier Chantry chantry.xavier at gmail.com
Tue Oct 19 14:39:31 EDT 2010


About my pending work on http://code.toofishes.net/cgit/xavier/pacman.git/

parseargs: sent to the ML and updated according to feedback

depwork: forgot if I send this stuff, should I ?

pactree: all the work I did with Dave Reisner on pactree C rewrite,
all ready and done now. depends on depwork for find_satisfier

sodeps: depends on parseargs because it changes one arg, and on
depwork (make depcmp private), because it changes many _alpm_depcmp to
_alpm_depcmp_tolerant. This was sent to ML. Nagy said it was ok. I
find this distinction between depcmp (ignore -Sdd) vs depcmp_tolerant
(respect -Sdd) a bit ugly, but I don't see any better way.

I am happy with parseargs, depwork, and pactree.

One small worry about depwork and its alpm_find_satisfier function :
the purpose of this function is kinda duplicated with "alpm/dep: add
alpm_find_dbs_satisfier" I made in working.
After writing alpm_find_dbs_satisfier, I thought I would kill
alpm_find_satisfier, but both have different advantages, and slightly
different purpose.

alpm_find_satisfier is very simple : it just calls
splitdep+_alpm_find_dep_satisfier, which are both very simple. It just
answers this question : is there one satisfier for this dep in this
package list ? Perfect for deptest / pacman -T, could be useful for
other tools.

alpm_find_dbs_satisfier: much more complex, but similar purpose. its
goal is to answer : which satisfier would pacman choose for this dep
in this list of sync dbs ? Less flexible than alpm_find_satisfier
(cannot give any list of package, it has to be one or more db), much
uglier and complex code. But it exposes exactly what pacman does to
find a satisfier :
- search literal in a first pass, provider in a second pass only if no literal
- for both pass, it scans the list of sync dbs in order, and the first
sync db has priority over the next ones
- handles ignorepkg with a QUESTION IgnorePkg callback (but this can
be disabled simply with no or empty conversation callback)
- handle multiple provision with another QUESTION callback, but same
as for ignorepkg

I needed alpm_find_dbs_satisfier to migrate pacman frontend to the
alpm_add_pkg(pmpkg_t *) interface. I decided to keep
alpm_find_satisfier anyway for its simplicity.

For the stuff on working, I probably need other mails to present it.


More information about the pacman-dev mailing list