From 4260b8f96c594c5653772a8f718e4cdb53a671ce Mon Sep 17 00:00:00 2001 From: graham.gower Date: Sun, 15 Nov 2009 21:36:38 -0500 Subject: 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 --- (limited to 'libopkg/opkg_remove.c') 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 -- cgit v0.9.1