[packagekit] Dependencies resolution
Daniel Nicoletti
dantti85-pk at yahoo.com.br
Mon Jul 13 07:23:56 PDT 2009
Hi again,
after a while discussing if we add a "simulate_" to the
apt problem, today I've found that I'm not alone in this problem
Talking with Mounir he told me that Portage does also
remove packages while installing.
This is not a bug in apt nor portage, it simple tryies to
keep your system working if you want to do things.
A simple use case would be one wants to install
exim4 which conflicts with (postfix|qmail|sendmail)
so if one of them is already installed it'll be asked to
remove.
So what we (apt and portage) need is a way to resolve
dependencies in a way that we can display packages
to be removed. They are rare but not impossible and
the command line is NOT an option for me.
Richard proposed guessing getDepends when recursive is enabled
and emit packages to be removed however in src/pk-transaction.c:823
it simply drops the package (which imo it's a bit of duplication since
we should already do that in the backend).
My idea them as Richard don't want to break API with "simulate_install"
and alike, is to add three new filters (with better naming):
PK_FILTER_ENUM_TO_INSTALL
PK_FILTER_ENUM_TO_REMOVE
PK_FILTER_ENUM_TO_UPDATE
And when the backend sees that together with recursive (imo recursive
could be even dropped with that), it starts the distro resolver,
apt and portage could do something like:
- User want's exim4
1. getDepends("exim4", PK_FILTER_ENUM_TO_INSTALL)
-- backend resolve exim4 dependencies
-- backend emit packages:
-- Package("exim4-common", PK_INFO_ENUM_AVAILABLE) = it's available so it WILL be INSTALLED
-- Package("postfix", PK_INFO_ENUM_INSTALLED) = it's installed so it WILL be REMOVED
-- Package("libc6", PK_INFO_ENUM_NORMAL) = it's a normal update so it WILL be UPDATED
** this last one could be optional to the backend author...
-------------------------------
1 Package to **REMOVE**
1 Package to install
1 Package to update
--------[OK]----[cancel]
2. installPkg(exim4)
---downloading exim4
---downloading exim4-common
---downloading libc6
---unpacking exim4
---unpacking exim4-common
---unpacking libc6
---removing postfix
---installing exim4
---installing exim4-common
---installing libc6
DONE :D
PS: As not all distros have this, the GUI will not be affected for them
we can detect if the list has packages with different states so we show
them in a tree or a list as usual.
Ideas, comments ... are all welcome :D
Daniel.
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
More information about the PackageKit
mailing list