[packagekit] Removing packages when updating: a possible solution
Daniel Nicoletti
dantti85-pk at yahoo.com.br
Mon Jul 20 13:07:20 PDT 2009
Well,
a week passed and none replied so I'll
start looking at the backend's code to see
which ones will need some changes
and try to write a patch.
Daniel.
----- Mensagem original ----
De: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Para: PackageKit <packagekit at lists.freedesktop.org>
Enviadas: Terça-feira, 14 de Julho de 2009 10:22:24
Assunto: [packagekit] Removing packages when updating: a possible solution
Hi,
This thread was renamed a few times,
but I did this trying to call the attention of
BACKEND DEVELOPERS. If you are one
please read, if not read it too :) you might have
a better idea ;)
The problem:
While updating/installing/removing some packages
might conflict with newer versions, which is a bit common
in Debian based distros and also in Portage (as Mounir said).
This behavior is not a bug and affects user apps like amule
since it depends on a lib that was compiled with foo support,
and that lib conflicts with the one compiled without foo support.
So the best idea we got so far, and that Richard
liked to is to remove the filter from getDepends and getRequires.
Today we do the following:
To install firefox:
getDepends("~installed", "firefox", recursive=true);
To updade firefox:
getDepends("~installed", "firefox", recursive=true);
To remove firefox:
getRequired("installed", "firefox", recursive=true);
As you can see we can't emit an installed package
with ~installed filter, or an AVAILABLE package with
installed filter.
But the recursive=true is always used to resolve dependencies
and it's ONLY used in install/remove/update operations.
Which makes recursive the main switch to know whether do
do a true dependency resolver.
With that in mind we can change our getDepends calls to:
To install firefox:
getDepends("NONE", "firefox", recursive=true);
To updade firefox:
getDepends("NONE", "firefox", recursive=true);
To remove firefox:
getRequired("NONE", "firefox", recursive=true);
Allowing backends such apt or portage to emit packages that are
going to be removed. And making our users happy not needing to
be eaten by CLI.
The switch is quite simple for backends that relly on "~installed" filters,
they can simply set the filter if recursive is =true.
One last thing that implies this solution is the creation of
ERROR_REMOVE_AUTH_REQUIRED and maybe
ERROR_INSTALL_AUTH_REQUIRED.
so if the backend detects it need to remove packages on an
update it checks to see if the transaction have the remove_auth
if not fail with this error and the GUI tools will ask for the proper
polkit action.
Please reply if this is or isn't a problem for your backend.
Thanks,
Daniel.
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
_______________________________________________
PackageKit mailing list
PackageKit at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/packagekit
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
More information about the PackageKit
mailing list