On Fri, Jul 29, 2011 at 10:04:26PM +0200, Michel Hermier 
<[email protected]> wrote:
> I didn't reached that code but yes. Currently the aims is at least to try
> to make the logic a little bit more readable and more object style.
> (If I can try to split the upgrade code out of remove and reduce some code
> duplication)

Oh, I didn't see your patch removes duplication. If so, I'm always
interested. :)

> > Note that in the db access case there are two users of that structs,
> > refactoring to use such a struct with a single user is unnecessary
> > complication, IMHO.
> 
> It add a little complication, but can help if tomorrow we need another db
> provider (like transparant db over network or whatever)

Nah, I mean it makes sense in case of the db code, it makes little sense
with the trans code.

> Well for now I don't know how to concontinue that. The code looks so
> complicated that I didn't find where packages from descriptors gets
> accepted for installation.

I thought after KDE you'll agree that the pacman code is simple. :)

Run 'git grep PM_PKG_DEPENDS' in lib/libpacman.c, all code messing with
the depends is in deps.c. What you need to do is refactor code iterating
through the dep list to separate functions, so you can do

do_something_with_list(_pacman_pkg_getinfo(pkg, PM_PKG_DEPENDS));
if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
        do_something_with_list(_pacman_pkg_getinfo(pkg, PM_PKG_RODEPENDS));
}

Attachment: pgpp8ei7NB1P0.pgp
Description: PGP signature

_______________________________________________
Frugalware-devel mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-devel

Reply via email to