summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 153c0426..c06a239b 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -42,12 +42,11 @@
#include "backup.h"
#include "package.h"
#include "db.h"
-#include "cache.h"
#include "deps.h"
#include "handle.h"
#include "alpm.h"
-int SYMEXPORT alpm_remove_target(char *target)
+int SYMEXPORT alpm_remove_target(const char *target)
{
pmpkg_t *info;
pmtrans_t *trans;
@@ -311,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));
@@ -345,10 +348,11 @@ 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);
- if(_alpm_db_remove(handle->db_local, oldpkg) == -1) {
+ if(_alpm_local_db_remove(handle->db_local, oldpkg) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s-%s\n"),
pkgname, alpm_pkg_get_version(oldpkg));
}
@@ -447,7 +451,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *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);
- if(_alpm_db_remove(db, info) == -1) {
+ if(_alpm_local_db_remove(db, info) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s-%s\n"),
pkgname, alpm_pkg_get_version(info));
}