FS#23011 - Don't remove replaces earlier than necessary
|
Details
As seen with util-linux-ng -> util-linux name
transition.
http://mailman.archlinux.org/pipermail/arch-dev-public/2011-February/019504.html We should really be treating util-linux-ng as the previous version counterpart to util-linux, just like we do on a normal upgrade (removing the local package first). This obviously gets a lot tricker when it isn't a 1-to-1 replacement, but we can still remove it as part of the first rather than at the start of the transaction. We also don't handle dependency resolution order quite right in this case, as util-linux ends up last even though the dep chain looks like this: kernel26 -> mkinitcpio -> util-linux-ng (replaced by util-linux) |
This task depends upon
This goes without saying. Interrupting *any* transaction during the install phase is dangerous.
- flatpak 0.9.8-1 is installed.
- flatpak 0.9.10-2 and flatpak-builder 0.9.9-1 are available.
- flatpak-builder has replaces=('flatpak<0.9.10') and depends=(flatpak)
If the user confirms the replace, pacman will first remove flatpak and later upgrade it, throwing two errors:
error: could not remove database entry flatpak-0.9.8-1
error: could not remove entry 'flatpak' from cache
The upgrade seems to work fine except for the noise. Perhaps this would cause more problems if flatpak had more complex pre/post scripts, as this bug probably triggers unwanted runs of the install and remove functions.