[pacman-dev] backup handling

Xavier shiningxc at gmail.com
Wed Sep 19 14:03:19 EDT 2007

On Wed, Sep 19, 2007 at 11:18:55AM -0500, Aaron Griffin wrote:
> What I'm saying is that we check the old and new backup arrays for
> pacsave files... I termed this "proactive backups" back in the day.
> That is, the first time a file is added to the backup array, it is not
> overwritten like it was in the past.
> So this check is _already_ there, it is just a check to see if a file
> is in the *new* backup array and not the *old* - we just need to
> reverse this to check for files in the *old* array no longer in the
> *new* array

I am confused.. I thought the proactive backup was mostly done in the part I
already copy/pasted in my original post :

298   /* Add files in the NEW package's backup array to the noupgrade array
299    * so this removal operation doesn't kill them */
300   /* TODO if we add here, all backup=() entries for all targets, new and
301    * old, we cover all bases, including backup=() locations changing hands.
302    * But is this viable? */
303   alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade);
304   for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
305     const char *backup = b->data;
306     _alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
307         backup);
308     handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(backup));
309   }

IE, it just uses the new backup array, disregarding the old (it doesn't
matter if the file is in the old backup array or not).

To be honest, I am a bit confused by this whole backup handling / proactive
backup stuff (but same for 90% of the pacman code), so I'll probably just give up :)

More information about the pacman-dev mailing list