-user_prefers_old_conffile(const char *file_name, const char *backup)
-{
- char *response;
- const char *short_file_name;
-
- short_file_name = strrchr(file_name, '/');
- if (short_file_name) {
- short_file_name++;
- } else {
- short_file_name = file_name;
- }
-
- while (1) {
- response = get_user_response(" Configuration file '%s'\n"
- " ==> File on system created by you or by a script.\n"
- " ==> File also in package provided by package maintainer.\n"
- " What would you like to do about it ? Your options are:\n"
- " Y or I : install the package maintainer's version\n"
- " N or O : keep your currently-installed version\n"
- " D : show the differences between the versions (if diff is installed)\n"
- " The default action is to keep your current version.\n"
- " *** %s (Y/I/N/O/D) [default=N] ? ", file_name, short_file_name);
-
- if (response == NULL)
- return 1;
-
- if (strcmp(response, "y") == 0
- || strcmp(response, "i") == 0
- || strcmp(response, "yes") == 0) {
- free(response);
- return 0;
- }
-
- if (strcmp(response, "d") == 0) {
- const char *argv[] = {"diff", "-u", backup, file_name, NULL};
- xsystem(argv);
- printf(" [Press ENTER to continue]\n");
- response = file_read_line_alloc(stdin);
- free(response);
- continue;
- }
-
- free(response);
- return 1;
- }
-}
-
-static int
-resolve_conffiles(opkg_conf_t *conf, pkg_t *pkg)