X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Fopkg_install.c;h=4889ad89d353a0dae60c085d5ede2031bdebe96f;hp=c8e6dc9126654bc7c638a7fe7f7a318d6471dafd;hb=2b696d8b96d28277137305526e5217752509b033;hpb=d09cea362eb6d39f75fc4b2566f2f2ed35e58757 diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index c8e6dc9..4889ad8 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -174,7 +174,7 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg) iter = niter, niter = str_list_next(old_list, niter)) { char *old_file = (char *)iter->data; pkg_t *owner = file_hash_get_file_owner(old_file); - if (owner == old_pkg) { + if (!owner || (owner == old_pkg)) { /* obsolete */ hash_table_insert(&conf->obs_file_hash, old_file, old_pkg); } @@ -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, "\n" + opkg_message(ERROR, "\n" "Please move this file out of the way and try again.\n"); } clashes++; } - free(root_filename); } pkg_free_installed_files(pkg);