summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-10-08 01:29:49 +0200
committerJudd Vinet <judd@archlinux.org>2005-10-08 01:29:49 +0200
commit5ef51b3e266cf43411947248886372001fdb207a (patch)
tree8d255349530045686053faacd1804502a96b269c /lib/libalpm/remove.c
parent79031ccd1a544475162facb8ca3d671f3464d1f8 (diff)
downloadpacman-5ef51b3e266cf43411947248886372001fdb207a.tar.gz
pacman-5ef51b3e266cf43411947248886372001fdb207a.tar.xz
Merging in recent fixes/additions from 2.9.7
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c52
1 files changed, 33 insertions, 19 deletions
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);
+ }
}
}
}