summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-15 21:36:38 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-15 21:36:38 (EST)
commit4260b8f96c594c5653772a8f718e4cdb53a671ce (patch)
treef8850769b8b558dfdc8c7086b67c8e608163b154
parent4496db0b9de9eb62799ec1d68255c12c1def1758 (diff)
Pass the correct file_name to pkg_get_conffile().
This should prevent modified conf files from being deleted for offline roots and non root dests. git-svn-id: http://opkg.googlecode.com/svn/trunk@317 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_remove.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
index 12d5d0c..eb03714 100644
--- a/libopkg/opkg_remove.c
+++ b/libopkg/opkg_remove.c
@@ -334,10 +334,14 @@ int remove_data_files_and_list(opkg_conf_t *conf, pkg_t *pkg)
conffile_t *conffile;
int removed_a_dir;
pkg_t *owner;
+ int rootdirlen;
str_list_init(&installed_dirs);
installed_files = pkg_get_installed_files(pkg);
+ /* don't include trailing slash */
+ rootdirlen = strlen(pkg->dest->root_dir) -1;
+
for (iter = str_list_first(installed_files); iter; iter = str_list_next(installed_files, iter)) {
file_name = (char *)iter->data;
@@ -346,7 +350,7 @@ int remove_data_files_and_list(opkg_conf_t *conf, pkg_t *pkg)
continue;
}
- conffile = pkg_get_conffile(pkg, file_name);
+ conffile = pkg_get_conffile(pkg, file_name+rootdirlen);
if (conffile) {
/* XXX: QUESTION: Is this right? I figure we only need to
save the conffile if it has been modified. Is that what