summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-12 22:29:59 +0200
committerDan McGee <dan@archlinux.org>2012-08-02 16:39:08 +0200
commit72d3713cc7865af5f4d91410ad56ed4287be6109 (patch)
treeb7a4a0ddf620e5fcdaffa85c91a7352570217f24 /lib/libalpm/remove.c
parent70d8c2150e33d1a0b9e09d72c5091d661383d641 (diff)
downloadpacman-72d3713cc7865af5f4d91410ad56ed4287be6109.tar.gz
pacman-72d3713cc7865af5f4d91410ad56ed4287be6109.tar.xz
Move filelist functions into separate source file
We have a few of these and might as well gather them together. This also cleans up the code a bit by using an enum instead of integer values, as well as makes a "search for file in filelist" function public so frontends can do better than straight linear search of the filelists. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 148cb863..4c549926 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -41,7 +41,7 @@
#include "db.h"
#include "deps.h"
#include "handle.h"
-#include "conflict.h"
+#include "filelist.h"
/**
* @brief Add a package removal action to the transaction.
@@ -323,7 +323,7 @@ static int unlink_file(alpm_handle_t *handle, alpm_pkg_t *oldpkg,
} else if(files < 0) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"keeping directory %s (could not count files)\n", file);
- } else if(newpkg && _alpm_filelist_contains(alpm_pkg_get_files(newpkg),
+ } else if(newpkg && alpm_filelist_contains(alpm_pkg_get_files(newpkg),
fileobj->name)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"keeping directory %s (in new package)\n", file);
@@ -343,7 +343,7 @@ static int unlink_file(alpm_handle_t *handle, alpm_pkg_t *oldpkg,
continue;
}
filelist = alpm_pkg_get_files(local_pkg);
- if(_alpm_filelist_contains(filelist, fileobj->name)) {
+ if(alpm_filelist_contains(filelist, fileobj->name)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"keeping directory %s (owned by %s)\n", file, local_pkg->name);
found = 1;
@@ -440,7 +440,7 @@ static int remove_package_files(alpm_handle_t *handle,
for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
const alpm_backup_t *backup = b->data;
/* safety check (fix the upgrade026 pactest) */
- if(!_alpm_filelist_contains(newfiles, backup->name)) {
+ if(!alpm_filelist_contains(newfiles, backup->name)) {
continue;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "adding %s to the skip_remove array\n",