[pacman-dev] backup handling ugly mess

Dan McGee dpmcgee at gmail.com
Wed Dec 5 21:25:54 EST 2007

On Dec 5, 2007 12:46 AM, Xavier <shiningxc at gmail.com> wrote:
> On Tue, Dec 04, 2007 at 09:18:08PM +0100, Xavier wrote:
> > The first part of this commit is supposed to temporarily add all old backup
> > entries (besides the new) to the NoUpgrade array. Because of a bug, it
> > didn't have any effect.
> >
> > The second part was an idea of me to handle the pacsave during an
> > removeupgrade just like we already did for a remove, but I finally think
> > this is a really stupid / misleading / confusing idea. This code shouldn't
> > even be reached during a removeupgrade if the first part was fixed anyway.
> >
> Here is a patch which fix the first part, and reverts the second.

OK, so I think I understand the problem here, and it makes sense. It
seems like manipulating backup arrays and merging them is probably a
bad idea.

Let me get this straight- your patch doesn't actually solve these
problems, just makes the existing code work as we thought it would?

Let's start by laying out a set of rules that pacman should follow,
then seeing if our pactests represent these cases. I'm only going to
cover upgrades, because removals are straightforward (always create
pacsave files of those in the backup array).
1. If the file is in the old backup array, and is then removed from
the backup array AND package, we should move it to pacsave.
2. If the file is in the old backup array, and is then removed from
the backup array BUT stays in the package, we have a gray area. We
need to choose- either install the new file as pacnew and leave the
old file (which would then be overwritten on the next upgrade because
it is no longer in the backup array, so probably not the best
solution), or do as upgrade025 does- move the existing file to pacsave
and install the new file.
3. If the file is in the old backup array, and stays in the backup
array BUT is removed from the package (bash), we should probably move
(or should we copy and leave the original?) the file to pacsave. This
is a gray area.

Note that we haven't even looked at the new backup array yet. I think
it may have been a bit naive to introduce that without much testing...
4. If the file exists in the old package BUT is not in the backup
array, but is in the backup array of the new package, we should either
install the new file as pacnew OR move existing file to pacsave and
install new file in original location. Not sure here.

Comments please, especially if I missed hard cases. Once we get this
hammered out this needs to be documented somewhere.


More information about the pacman-dev mailing list