Package: jadetex
Version: 3.13-4
Severity: normal

I experienced the following while upgrading to jadetex 3.13-4:

  Preparing to replace jadetex 3.13-3 (using .../jadetex_3.13-4_all.deb) ...
  Unpacking replacement jadetex ...
[...]
  Setting up jadetex (3.13-4) ...

  Configuration file `/etc/texmf/fmt.d/40jadetex.cnf'
   ==> 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     : background this process to examine the situation
   The default action is to keep your current version.
  *** 40jadetex.cnf (Y/I/N/O/D/Z) [default=N] ? y
  Installing new version of config file /etc/texmf/fmt.d/40jadetex.cnf ...
  mktexlsr: Updating /usr/local/share/texmf/ls-R...
  mktexlsr: Updating /usr/local/lib/texmf/ls-R...
  mktexlsr: Updating /var/lib/texmf/ls-R...
  mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN...
  mktexlsr: Updating /var/cache/fonts/ls-R...
  mktexlsr: Done.
  Checking for TeX memory dumps (.fmt) ...
     done.
  Creating JadeTeX memory dumps ...
  /usr/share/texmf/tex/jadetex/config/jadetex.ini
  fmtutil: /var/lib/texmf/web2c/jadetex.efmt installed.
  /usr/share/texmf/tex/jadetex/config/jadetex.ini
  fmtutil: /var/lib/texmf/web2c/pdfjadetex.efmt installed.
     done.

I shouldn't have been given a conffile prompt, as I've never customized
that file, and in fact didn't even know it existed.

Steve Langasek tells me this is because /etc/texmf/fmt.d/40jadetex.cnf used
to be a non-conffile configuration file (created by the package "manually"
rather than unpacked to the system), and therefore dpkg believes the local
admin had put the file there.

If there's a small set of existing ways for that file to look, you might be
able to enhance your preinst script to detect an already-installed stock
version and move it out of the way.  Because the preinst and postinst
scripts can fail, I would do this transactionally, with a prepare/commit
(or prepare/rollback) approach.

I have had to do something very similar in xfree86, where I have *stopped*
making certain files conffiles.  I therefore offer three shell functions
(attached) which you may want to adapt to your needs.

Please let me know if you need any explanations or assistance with this.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.9-powerpc-smp
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages jadetex depends on:
ii  debianutils                   2.13.2     Miscellaneous utilities specific t
ii  tetex-bin                     2.0.2-26   The teTeX binary files
ii  tetex-extra                   2.0.2c-7   Additional library files of teTeX

Versions of packages tetex-base depends on:
ii  debconf                       1.4.47     Debian configuration management sy
ii  dpkg                          1.10.27    Package maintenance system for Deb
ii  texinfo                       4.7-2.2    Documentation system for on-line i
ii  ucf                           1.17       Update Configuration File: preserv

Versions of packages tetex-bin depends on:
ii  debconf                  1.4.47          Debian configuration management sy
ii  debianutils              2.13.2          Miscellaneous utilities specific t
ii  dpkg                     1.10.27         Package maintenance system for Deb
ii  ed                       0.2-20          The classic unix line editor
ii  libc6                    2.3.2.ds1-20    GNU C Library: Shared libraries an
ii  libgcc1                  1:3.4.3-12      GCC support library
ii  libice6                  4.3.0.dfsg.1-12 Inter-Client Exchange library
ii  libkpathsea3             2.0.2-26        path search library for teTeX (run
ii  libpaper1                1.1.14-3        Library for handling paper charact
ii  libpng12-0               1.2.8rel-1      PNG library - runtime
ii  libsm6                   4.3.0.dfsg.1-12 X Window System Session Management
ii  libstdc++5               1:3.3.5-12      The GNU Standard C++ Library v3
ii  libt1-5                  5.0.2-3         Type 1 font rasterizer library - r
ii  libwww-ssl0 [libwww0]    5.4.0-9         The W3C-WWW library (SSL support)
ii  libx11-6                 4.3.0.dfsg.1-12 X Window System protocol client li
ii  libxaw7                  4.3.0.dfsg.1-12 X Athena widget set library
ii  libxext6                 4.3.0.dfsg.1-12 X Window System miscellaneous exte
ii  libxmu6                  4.3.0.dfsg.1-12 X Window System miscellaneous util
ii  libxt6                   4.3.0.dfsg.1-12 X Toolkit Intrinsics
ii  mime-support             3.31-1          MIME files 'mime.types' & 'mailcap
ii  perl                     5.8.4-8         Larry Wall's Practical Extraction 
ii  sed                      4.1.4-2         The GNU sed stream editor
ii  tetex-base               2.0.2c-7        Basic library files of teTeX
ii  ucf                      1.17            Update Configuration File: preserv
ii  xlibs                    4.3.0.dfsg.1-12 X Keyboard Extension (XKB) configu
ii  zlib1g                   1:1.2.2-4       compression library - runtime

Versions of packages tetex-extra depends on:
ii  dpkg                      1.10.27        Package maintenance system for Deb
ii  gsfonts                   8.14+v8.11-0.1 Fonts for the Ghostscript interpre
ii  tetex-base                2.0.2c-7       Basic library files of teTeX
ii  tetex-bin                 2.0.2-26       The teTeX binary files
ii  ucf                       1.17           Update Configuration File: preserv

-- debconf information:
  tetex-base/olddat: true
  tetex-base/fmtutil-failed:
  tetex-bin/upd_map: true
  tetex-bin/cnf_name:
  tetex-bin/fmtutil: true
  tetex-bin/fmtutil-failed:
  tetex-bin/userperm: false
  tetex-bin/updmap-failed:
* tetex-bin/hyphen:
  tetex-bin/oldcfg: true
  tetex-base/oldupdm:
  tetex-base/updmap-failed:
* tetex-bin/use_debconf: false
  tetex-bin/groupname: users
  tetex-bin/groupperm: true
  tetex-bin/lsr-perms: true
# NOTE: You will need to replace the following variable and function names:
# $SHELL_LIB_USAGE_ERROR
# $THIS_PACKAGE
# observe
# usage_error

remove_conffile_prepare () {
  # syntax: remove_conffile_prepare filename official_md5sum ...
  #
  # Check a conffile "filename" against a list of canonical MD5 checksums.
  # If the file's current MD5 checksum matches one of the "official_md5sum"
  # operands provided, then prepare the conffile for removal from the system.
  # We defer actual deletion until the package is configured so that we can
  # roll this operation back if package installation fails.
  #
  # Call this function from a preinst script in the event $1 is "upgrade" or
  # "install" and verify $2 to ensure the package is being upgraded from a
  # version (or installed over a version removed-but-not-purged) prior to the
  # one in which the conffile was obsoleted.

  # validate arguments
  if [ $# -lt 2 ]; then
    usage_error "remove_conffile_prepare() called with wrong number of" \
                "arguments; expected at least 2, got $#"
    exit $SHELL_LIB_USAGE_ERROR
  fi

  conffile="$1"
  shift

  # does the conffile even exist?
  if [ -e "$conffile" ]; then
    # calculate its checksum
    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
    # compare it to each supplied checksum
    while [ -n "$1" ]; do
      if [ "$current_checksum" = "$1" ]; then
        # we found a match; move the confffile and stop looking
        observe "preparing obsolete conffile $conffile for removal"
        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
        break
      fi
      shift
    done
  fi
}

remove_conffile_commit () {
  # syntax: remove_conffile_commit filename
  #
  # Complete the removal of a conffile "filename" that has become obsolete.
  #
  # Call this function from a postinst script after having used
  # remove_conffile_prepare() in the preinst.

  # validate arguments
  if [ $# -ne 1 ]; then
    usage_error "remove_conffile_commit() called with wrong number of" \
                "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
  fi

  conffile="$1"

  # if the temporary file created by remove_conffile_prepare() exists, remove it
  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
    observe "committing removal of obsolete conffile $conffile"
    rm "$conffile.$THIS_PACKAGE-tmp"
  fi
}

remove_conffile_rollback () {
  # syntax: remove_conffile_rollback filename
  #
  # Roll back the removal of a conffile "filename".
  #
  # Call this function from a postrm script in the event $1 is "abort-upgrade"
  # or "abort-install" is  after having used remove_conffile_prepare() in the
  # preinst.

  # validate arguments
  if [ $# -ne 1 ]; then
    usage_error "remove_conffile_rollback() called with wrong number of" \
                "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
  fi

  conffile="$1"

  # if the temporary file created by remove_conffile_prepare() exists, move it
  # back
  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
    observe "rolling back removal of obsolete conffile $conffile"
    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
  fi
}

Reply via email to