From 10f0dceaf9ed1dea7c2ed7d41e7a748d34dd9324 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Fri, 17 Apr 2009 03:59:05 -0400 Subject: 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 --- (limited to 'libopkg/opkg_install.c') 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); -- cgit v0.9.1