[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#102609: dpkg: --force-confask - replace conffiles with no new version



retitle 102609 dpkg: --force-confask - replace conffiles with no new version
tag 102609 + patch
thanks

This patch adds a force option to dpkg which will cause it to offer to
replace a locally changed conffile with the file provided in the .deb
even if the .deb's file has not changed since the current
installation.  This is occasionally useful for error recovery, even
though the original submitter's idea of using it as a default
"beginner mode" is clearly a bad idea.

diff -ur dpkg-1.10.18.old/main/configure.c dpkg-1.10.18/main/configure.c
--- dpkg-1.10.18.old/main/configure.c	Sat Oct 25 21:03:20 2003
+++ dpkg-1.10.18/main/configure.c	Fri Dec 26 05:45:44 2003
@@ -210,6 +210,8 @@
 				useredited= strcmp(conff->hash,currenthash) != 0;
 				distedited= strcmp(conff->hash,newdisthash) != 0;
 				what= conffoptcells[useredited][distedited];
+                                if (fc_conff_ask && useredited)
+                                        what= conffoptcells[1][1];
 			}
 
 			debug(dbg_conff,
diff -ur dpkg-1.10.18.old/main/main.c dpkg-1.10.18/main/main.c
--- dpkg-1.10.18.old/main/main.c	Sat Oct 25 21:03:21 2003
+++ dpkg-1.10.18/main/main.c	Fri Dec 26 05:40:08 2003
@@ -138,6 +138,7 @@
 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 fc_badverify = 0;
+int fc_conff_ask = 0;
 
 int errabort = 50;
 const char *admindir= ADMINDIR;
@@ -158,6 +159,7 @@
   { "confold",             &fc_conff_old                },
   { "confdef",             &fc_conff_def                },
   { "confmiss",            &fc_conff_miss               },
+  { "confask",             &fc_conff_ask                },
   { "depends",             &fc_depends                  },
   { "depends-version",     &fc_dependsversion           },
   { "auto-select",         &fc_autoselect               },
@@ -313,6 +315,7 @@
                          you will be prompted unless one of the confold or\n\
                          confnew options is also given\n\
   confmiss [!]           Always install missing config files\n\
+  confask [!]            Offer to replace config files with no new versions\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\
diff -ur dpkg-1.10.18.old/main/main.h dpkg-1.10.18/main/main.h
--- dpkg-1.10.18.old/main/main.h	Mon May 20 06:56:01 2002
+++ dpkg-1.10.18/main/main.h	Fri Dec 26 05:41:19 2003
@@ -87,6 +87,7 @@
 extern int fc_nonroot, fc_overwritedir, fc_conff_new, fc_conff_miss;
 extern int fc_conff_old, fc_conff_def;
 extern int fc_badverify;
+extern int fc_conff_ask;
 
 extern int errabort;
 extern const char *admindir;
diff -ur dpkg-1.10.18.old/man/en/dpkg.8.sgml dpkg-1.10.18/man/en/dpkg.8.sgml
--- dpkg-1.10.18.old/man/en/dpkg.8.sgml	Mon May 13 22:00:32 2002
+++ dpkg-1.10.18/man/en/dpkg.8.sgml	Fri Dec 26 05:50:31 2003
@@ -1088,6 +1088,20 @@
 	    </varlistentry>
 
 	    <varlistentry>
+	      <term>confask</term>
+
+	      <listitem><para>
+		If a conffile has been modified always offer to
+		replace it with the version in the package, even if
+                the version in the package did not change. If one of
+                <option>--force-confnew</option>,
+		<option>--force-confold</option>, or
+		<option>--force-confdef</option> is also given, it
+		will be used to decide the final action.
+	      </para></listitem>
+	    </varlistentry>
+
+	    <varlistentry>
 	      <term>overwrite</term>
 
 	      <listitem><para>


-- 
Henning Makholm               "... not one has been remembered from the time
                         when the author studied freshman physics. Quite the
            contrary: he merely remembers that such and such is true, and to
          explain it he invents a demonstration at the moment it is needed."



Reply to: