summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-10 03:30:15 (EDT)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-10 03:30:15 (EDT)
commit66a14488ce415c2fb01d8dc383631681e8dc81ee (patch)
treecca8548e39649552244f6756c966333af03077f0 /libopkg
parent5161628bdab57405a6fa6eec0366439d6d375c63 (diff)
Fix check_data_file_clashes() for offline root mode. (almost anyway)
pkg_get_installed_files() returns a list of files with the offline root path already included, so don't add it again. Fix some error message formatting while here. git-svn-id: http://opkg.googlecode.com/svn/trunk@532 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/opkg_install.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index c8e6dc9..f67593d 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -748,7 +748,7 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
*/
str_list_t *files_list;
str_list_elt_t *iter, *niter;
-
+ char *filename;
int clashes = 0;
files_list = pkg_get_installed_files(pkg);
@@ -758,14 +758,12 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter);
iter;
iter = niter, niter = str_list_next(files_list, iter)) {
- char *root_filename;
- char *filename = (char *) iter->data;
- root_filename = root_filename_alloc(filename);
- if (file_exists(root_filename) && (! file_is_dir(root_filename))) {
+ filename = (char *) iter->data;
+ if (file_exists(filename) && (! file_is_dir(filename))) {
pkg_t *owner;
pkg_t *obs;
- if (backup_exists_for(root_filename)) {
+ if (backup_exists_for(filename)) {
continue;
}
@@ -816,14 +814,13 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
"\tBut that file is already provided by package ",
pkg->name, filename);
if (owner) {
- opkg_msg(ERROR, "%s\n", owner->name);
+ opkg_message(ERROR, "%s\n", owner->name);
} else {
- opkg_msg(ERROR, "<no package>\n"
+ opkg_message(ERROR, "<no package>\n"
"Please move this file out of the way and try again.\n");
}
clashes++;
}
- free(root_filename);
}
pkg_free_installed_files(pkg);