Do not fail in upgrade mode (-u) when configuration files have been modified
authorMichael Prokop <mika@grml.org>
Mon, 26 May 2014 08:49:00 +0000 (10:49 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 26 May 2014 08:49:00 +0000 (10:49 +0200)
Custom configuration files might be present and upgrading
packages might fail then:

| Setting up sudo (1.8.9p5-1) ...
|
| Configuration file '/etc/sudoers'
|  ==> File on system created by you or by a script.
|  ==> File also in package provided by package maintainer.
|    What would you like to do about it ?  Your options are:
|     Y or I  : install the package maintainer's version
|     N or O  : keep your currently-installed version
|       D     : show the differences between the versions
|       Z     : start a shell to examine the situation
|  The default action is to keep your current version.
| *** sudoers (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package sudo (--configure):

etc/grml/fai/config/hooks/instsoft.GRMLBASE

index cb0bbc1..78a9f57 100755 (executable)
@@ -74,6 +74,10 @@ EOF
      APTITUDE_OPTS="${APTITUDE_OPTS:-} --allow-untrusted"
    fi
 
+   # make sure we don't fail when configuration files changed
+   APTGET_OPTS="${APTGET_OPTS:-} -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confmiss -o DPkg::Options::=--force-confnew"
+   APTITUDE_OPTS="${APTITUDE_OPTS:-} -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confmiss -o DPkg::Options::=--force-confnew"
+
    if $ROOTCMD test -x /usr/bin/aptitude ; then
       if $ROOTCMD aptitude --help | grep -q safe-upgrade ; then
          APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD aptitude -y $APTITUDE_OPTS safe-upgrade