index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Judd Vinet <judd@archlinux.org> | 2005-10-07 23:29:49 +0000 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2005-10-07 23:29:49 +0000 |
commit | 5ef51b3e266cf43411947248886372001fdb207a (patch) | |
tree | 8d255349530045686053faacd1804502a96b269c /lib/libalpm/remove.c | |
parent | 79031ccd1a544475162facb8ca3d671f3464d1f8 (diff) |
-rw-r--r-- | lib/libalpm/remove.c | 52 |
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index fd00eae1..0e335906 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -191,28 +191,42 @@ int remove_commit(pmtrans_t *trans, pmdb_t *db) _alpm_log(PM_LOG_FLOW2, "removing directory %s", file); } } else { - /* if the file is flagged, back it up to .pacsave */ - if(nb) { - if(trans->type == PM_TRANS_TYPE_UPGRADE) { - /* we're upgrading so just leave the file as is. pacman_add() will handle it */ - } else { - if(!(trans->flags & PM_TRANS_FLAG_NOSAVE)) { - char newpath[PATH_MAX]; - snprintf(newpath, PATH_MAX, "%s.pacsave", line); - rename(line, newpath); - _alpm_log(PM_LOG_WARNING, "%s saved as %s", file, newpath); - alpm_logaction("%s saved as %s", line, newpath); + /* check the "skip list" before removing the file. + * see the big comment block in db_find_conflicts() for an + * explanation. */ + int skipit = 0; + PMList *j; + for(j = trans->skiplist; j; j = j->next) { + if(!strcmp(file, (char*)j->data)) { + skipit = 1; + } + } + if(skipit) { + _alpm_log(PM_LOG_FLOW2, "skipping removal of %s as it has moved to another package\n", file); + } else { + /* if the file is flagged, back it up to .pacsave */ + if(nb) { + if(trans->type == PM_TRANS_TYPE_UPGRADE) { + /* we're upgrading so just leave the file as is. pacman_add() will handle it */ } else { - _alpm_log(PM_LOG_FLOW2, "unlinking %s", file); - if(unlink(line)) { - _alpm_log(PM_LOG_ERROR, "cannot remove file %s", file); + if(!(trans->flags & PM_TRANS_FLAG_NOSAVE)) { + char newpath[PATH_MAX]; + snprintf(newpath, PATH_MAX, "%s.pacsave", line); + rename(line, newpath); + _alpm_log(PM_LOG_WARNING, "%s saved as %s", file, newpath); + alpm_logaction("%s saved as %s", line, newpath); + } else { + _alpm_log(PM_LOG_FLOW2, "unlinking %s", file); + if(unlink(line)) { + _alpm_log(PM_LOG_ERROR, "cannot remove file %s", file); + } } } - } - } else { - _alpm_log(PM_LOG_FLOW2, "unlinking %s", file); - if(unlink(line)) { - _alpm_log(PM_LOG_ERROR, "cannot remove file %s", file); + } else { + _alpm_log(PM_LOG_FLOW2, "unlinking %s", file); + if(unlink(line)) { + _alpm_log(PM_LOG_ERROR, "cannot remove file %s", file); + } } } } |