summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_install.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-04-17 03:59:05 (EDT)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-04-17 03:59:05 (EDT)
commit10f0dceaf9ed1dea7c2ed7d41e7a748d34dd9324 (patch)
treeac096c4b65a6fae0d7fe66640ab3e3dfe71843d1 /libopkg/opkg_install.c
parent17afa481c6b0bee87de3896a498c4c6a4de8f838 (diff)
adding new flag flag_maintainer
This flag is used for maintainer can use the latest conffile. this flag need to be set manually. git-svn-id: http://opkg.googlecode.com/svn/trunk@212 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_install.c')
-rw-r--r--libopkg/opkg_install.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index 719090b..aba0d1e 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -1590,18 +1590,20 @@ static int resolve_conffiles(opkg_conf_t *conf, pkg_t *pkg)
cf_backup = backup_filename_alloc(root_filename);
- if (file_exists(cf_backup)) {
- /* Let's compute md5 to test if files are changed */
- md5sum = file_md5sum_alloc(cf_backup);
- if (strcmp( cf->value,md5sum) != 0 ) {
- if (conf->force_defaults
- || user_prefers_old_conffile(cf->name, cf_backup) ) {
- rename(cf_backup, root_filename);
- }
- }
- unlink(cf_backup);
- free(md5sum);
- }
+ if (file_exists(cf_backup)) {
+ /* Let's compute md5 to test if files are changed */
+ md5sum = file_md5sum_alloc(cf_backup);
+ if (strcmp( cf->value,md5sum) != 0 ) {
+ if (conf->force_maintainer) {
+ opkg_message(conf, OPKG_NOTICE, "Conffile %s using maintainer's setting.\n", cf_backup);
+ } else if (conf->force_defaults
+ || user_prefers_old_conffile(cf->name, cf_backup) ) {
+ rename(cf_backup, root_filename);
+ }
+ }
+ unlink(cf_backup);
+ free(md5sum);
+ }
free(cf_backup);
free(root_filename);