* Reinstate patch to not read available-file with doing listfiles.
* Don't forget to get the correct SHELL before showing a diff of
conffiles!
+ * Merge a patch from Ben Collins to add a bunch of --force options
+ to handle changed conffiles
Thu Oct 14 03:37:52 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
* dpkg-scanpackages: don't abort but only skip a package if we can't
open it
* Add HURD-support to start-stop-daemon
+ * Reinstate patch to not read available when doing --list-files
+ * Add a couple of --force options to handle changed conffiles
- -- Wichert Akkerman <wakkerma@debian.org> Wed, 13 Oct 1999 21:52:17 +0200
+ -- Wichert Akkerman <wakkerma@debian.org> Thu, 14 Oct 1999 04:20:56 +0200
dpkg (1.4.1.14) unstable; urgency=low
useredited= -1;
distedited= -1;
what= cfo_identical;
+ } else if (!strcmp(currenthash,NONEXISTENTFLAG) && fc_conff_miss) {
+ fprintf(stderr, _("\nConfiguration file `%s', does not exist on system.\n"
+ "Installing new config file as you request.\n"), conff->name);
+ what= cfo_newconff;
+ useredited= -1;
+ distedited= -1;
} else if (!strcmp(conff->hash,NEWCONFFILEFLAG)) {
if (!strcmp(currenthash,NONEXISTENTFLAG)) {
what= cfo_newconff;
"deferred_configure `%s' (= `%s') useredited=%d distedited=%d what=%o",
conff->name, cdr.buf, useredited, distedited, what);
+ /* When prompting we check for some of the force options. There are
+ * several cases in which these occur.
+ * - We have --force-confnew, in which we always use the new config file
+ * - We have --force-confold, in which we always use the old config file
+ * - We have --force-confdef, in which we always use the default action
+ * if there is one. Note, there are cases where we will still prompt
+ * - If we have --force-confdef and one of the others (new/old) then we
+ * always use the default where we can. If there is no default, then we
+ * use the new or old, depending on which --force-conf{old,new} was used.
+ */
if (what & cfof_prompt) {
do {
}
+ if (!(fc_conff_def && (what & (cfof_install|cfof_keep)))) {
+ if (fc_conff_new) {
+ fprintf(stderr, _(" ==> Using new file as you requested.\n"));
+ cc = 'y';
+ break;
+ } else if (fc_conff_old) {
+ fprintf(stderr, _(" ==> Using current old file as you requested.\n"));
+ cc = 'n';
+ break;
+ }
+ }
+
+ if (what & cfof_keep && fc_conff_def) {
+ fprintf(stderr, _(" ==> Keeping old config file as default.\n"));
+ cc = 'n';
+ break;
+ } else if (what & cfof_install && fc_conff_def) {
+ fprintf(stderr, _(" ==> Using new config file as default.\n"));
+ cc = 'y';
+ break;
+ }
+
fprintf(stderr,
_(" What would you like to do about it ? Your options are:\n"
" Y or I : install the package maintainer's version\n"
int fc_downgrade=1, fc_configureany=0, fc_hold=0, fc_removereinstreq=0, fc_overwrite=0;
int fc_removeessential=0, fc_conflicts=0, fc_depends=0, fc_dependsversion=0;
int fc_autoselect=1, fc_badpath=0, fc_overwritediverted=0, fc_architecture=0;
-int fc_nonroot=0, fc_overwritedir=0;
+int fc_nonroot=0, fc_overwritedir=0, fc_conff_new=0, fc_conff_miss=0;
+int fc_conff_old=0, fc_conff_def=0;
int errabort = 50;
const char *admindir= ADMINDIR;
{ "remove-reinstreq", &fc_removereinstreq },
{ "remove-essential", &fc_removeessential },
{ "conflicts", &fc_conflicts },
+ { "confnew", &fc_conff_new },
+ { "confold", &fc_conff_old },
+ { "confdef", &fc_conff_def },
+ { "confmiss", &fc_conff_miss },
{ "depends", &fc_depends },
{ "depends-version", &fc_dependsversion },
{ "auto-select", &fc_autoselect },
overwrite-diverted Overwrite a diverted file with an undiverted version\n\
depends-version [!] Turn dependency version problems into warnings\n\
depends [!] Turn all dependency problems into warnings\n\
+ confnew [!] Always use the new config files, don't prompt\n\
+ confold [!] Always use the old config files, don't prompt\n\
+ confdef [!] Use the default option for new config files if one\n\
+ is available, don't prompt. If no default can be found,\n\
+ you will be prompted unless one of the confold or\n\
+ confnew options is also given\n\
+ confmiss [!] Always install missing config files\n\
conflicts [!] Allow installation of conflicting packages\n\
architecture [!] Process even packages with wrong architecture\n\
overwrite-dir [!] Overwrite one package's directory with another's file\n\
extern int fc_downgrade, fc_configureany, fc_hold, fc_removereinstreq, fc_overwrite;
extern int fc_removeessential, fc_conflicts, fc_depends, fc_dependsversion;
extern int fc_autoselect, fc_badpath, fc_overwritediverted, fc_architecture;
-extern int fc_nonroot, fc_overwritedir;
+extern int fc_nonroot, fc_overwritedir, fc_conff_new, fc_conff_miss;
+extern int fc_conff_old, fc_conff_def;
extern int errabort;
extern const char *admindir;
int ignore_depends(struct pkginfo *pkg);
int force_depends(struct deppossi *possi);
+int force_conff_new(struct deppossi *possi);
+int force_conff_miss(struct deppossi *possi);
int force_conflicts(struct deppossi *possi);
void ensure_package_clientdata(struct pkginfo *pkg);
const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);