[pacman-dev] [PATCH] Cleanup code handling a sysupgrade of pacman itself

Xavier shiningxc at gmail.com
Wed Jun 13 10:43:10 EDT 2007


The main problem I had with this part is the problems it caused during
pacman 2 -> pacman 3 upgrade (where pacman got new dependencies,
libarchive and libdownload).

Apparently, pacman2 first got a list of upgrade and resolved the
dependencies, then checked if it was in the target list, and if it
was, removed every package but itself from the target list (including
its own new dependencies). And then it didn't resolve deps again
either.

On the other hand, pacman3 first adds the list of upgrade to the
targets by calling alpm_trans_sysupgrade, then it checks if pacman is
one of them. In this case, it cancels the old transaction and creates
a new one with only pacman as target.
And only then, it calls alpm_trans_prepare, which will resolve the dependencies.

Attaching a pactest which should emulate pacman 2 -> pacman 3 upgrade,
but it's now handled fine by pacman3 (not sure this test is very
interesting).

I let you decide if this behavior of automatically upgrading itself
first is needed (apparently, it was in the past).
And if it's needed, but you find the code ugly, maybe there are other
ways of doing it better ?
I personally don't have problems with this part, as it apparently now
does its job correctly, but it doesn't mean it's good :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sync301.py
Type: application/octet-stream
Size: 584 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20070613/8a115d0b/attachment.obj>


More information about the pacman-dev mailing list