+2006-02-10 Ian Jackson <iwj@ubuntu.com>
+
+ * src/configure.c: Differentiate between modified
+ and deleted configuration files. Gives and more
+ accurate description to the user and eliminates
+ a warning that was produced when trying to
+ backup a non-existant file.
+
2006-02-10 James R. Van Zandt <jrvz@comcast.net>
* man/C/dpkg.1: Document the default log file. The behaviour in case
useredited= strcmp(conff->hash,currenthash) != 0;
distedited= strcmp(conff->hash,newdisthash) != 0;
what= conffoptcells[useredited][distedited];
+ if (!strcmp(currenthash,NONEXISTENTFLAG))
+ what |= cfof_userrmd;
}
debug(dbg_conff,
what=promptconfaction(conff->name, cdr.buf, cdr2.buf, useredited, distedited, what);
- switch (what & ~cfof_isnew) {
+ switch (what & ~(cfof_isnew|cfof_userrmd)) {
case cfo_keep | cfof_backup:
strcpy(cdr2rest,DPKGOLDEXT);
if (unlink(cdr2.buf) && errno != ENOENT)
fprintf(stderr,
_("dpkg: %s: warning - failed to remove `%.250s' (before overwrite): %s\n"),
pkg->name, cdr2.buf, strerror(errno));
- if (link(cdr.buf,cdr2.buf))
- fprintf(stderr,
+ if (!(what & cfof_userrmd))
+ if (link(cdr.buf,cdr2.buf))
+ fprintf(stderr,
_("dpkg: %s: warning - failed to link `%.250s' to `%.250s': %s\n"),
pkg->name, cdr.buf, cdr2.buf, strerror(errno));
/* fall through */
" ==> File on system created by you or by a script.\n"
" ==> File also in package provided by package maintainer.\n"));
} else {
- fprintf(stderr, useredited ?
+ fprintf(stderr, !useredited ?
+ _("\n Not modified since installation.\n") :
+ !(what & cfof_userrmd) ?
_("\n ==> Modified (by you or by a script) since installation.\n") :
- _("\n Not modified since installation.\n"));
+ _("\n ==> Deleted (by you or by a script) since installation.\n"));
fprintf(stderr, distedited ?
_(" ==> Package distributor has shipped an updated version.\n") :
log_message("conffile %s %s", cfgfile,
(cc == 'i' || cc == 'y') ? "install" : "keep");
+ what &= cfof_userrmd;
+
switch (cc) {
case 'i':
case 'y':
- what=cfof_install|cfof_backup;
+ what |= cfof_install|cfof_backup;
break;
case 'n':
case 'o':
- what=cfof_keep|cfof_backup;
+ what |= cfof_keep|cfof_backup;
break;
default: