summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorXavier Chantry <chantry.xavier@gmail.com>2010-10-12 00:42:04 +0200
committerDan McGee <dan@archlinux.org>2010-12-13 03:19:24 +0100
commitabefa23341caa995cc0d155d30baa7faeb7a6c0e (patch)
treee723b522e8c34458019c2496a586e8f449760feb /lib
parent3a9dec104858a64489b004296d009c8222e7f040 (diff)
downloadpacman-abefa23341caa995cc0d155d30baa7faeb7a6c0e.tar.gz
pacman-abefa23341caa995cc0d155d30baa7faeb7a6c0e.tar.xz
alpm/remove.c : respect --dbonly during remove-upgrade
When a -Sk or -Uk operation induced a removal of an existing local package, --dbonly was not in effect and the files were all removed. Fixing this behavior was already marked as TODO in database012 pactest ------------ TODO: I honestly think the above should NOT delete the original les, it hould upgrade the DB entry without touching anything on the file stem. E.g. this test should be the same as: pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz ------------ Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> [Dan: small coding style touchup] Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/remove.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index b2137b19..0bcf5521 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -310,6 +310,10 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *tra
_alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)\n",
oldpkg->name, oldpkg->version);
+ if(trans->flags & PM_TRANS_FLAG_DBONLY) {
+ goto db;
+ }
+
/* copy the remove skiplist over */
skip_remove =
alpm_list_join(alpm_list_strdup(trans->skip_remove),alpm_list_strdup(handle->noupgrade));
@@ -344,6 +348,7 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *tra
alpm_list_free(newfiles);
FREELIST(skip_remove);
+db:
/* remove the package from the database */
_alpm_log(PM_LOG_DEBUG, "updating database\n");
_alpm_log(PM_LOG_DEBUG, "removing database entry '%s'\n", pkgname);