summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-10 22:07:58 (EDT)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-10 22:07:58 (EDT)
commit5a23a432b0a45ff4774a9968895ee87d60e70f03 (patch)
treee1b802c8577cdc1fcc6f4572aa888b57c943dcaf
parent154f3993b8112021e79beac00128547d333b808d (diff)
Claim ownership of a file if the previous owner has obsoleted it.
This commit, along with the last few, should fix Issue #50. git-svn-id: http://opkg.googlecode.com/svn/trunk@536 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_install.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index 88fed59..16b5be9 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -156,9 +156,12 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg)
iter = niter, niter = str_list_next(new_list, niter)) {
char *new_file = (char *)iter->data;
pkg_t *owner = file_hash_get_file_owner(new_file);
- if (!new_file)
- opkg_msg(ERROR, "Null new_file for new_pkg=%s\n", new_pkg->name);
- if (!owner || (owner == old_pkg))
+ pkg_t *obs = hash_table_get(&conf->obs_file_hash, new_file);
+
+ opkg_msg(DEBUG2, "%s: new_pkg=%s wants file %s, from owner=%s\n",
+ __func__, new_pkg->name, new_file, owner?owner->name:"<NULL>");
+
+ if (!owner || (owner == old_pkg) || obs)
file_hash_set_file_owner(new_file, new_pkg);
}