4:18
  "   ˆl–Ým_J*j"Tâ�nãm\må1hß¿ƒh¹ÂÁ      1843200
  "   	ˆl–Ým_J*j"Tâ�ràq ©‹FÿÀƒh¹ÃÂ      	auto
  :   ˆl–Ðz¾”*hŠq@³q¦®•1hßÁ„B'¿a–Ým_J*j"Tâ�rà¸'ÔÅ£Ä ?÷     #!/usr/bin/sh
#
# Copyright Â© 2005 Scott James Remnant
# Copyright Â© 2008 Joey Hess <joeyh@debian.org>
# Copyright Â© 2007, 2011-2015 Guillem Jover <guillem@debian.org>
# Copyright Â© 2010 RaphaÃ«l Hertzog <hertzog@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# The conffile related functions are inspired by
# https://wiki.debian.org/DpkgConffileHandling

# This script is documented in dpkg-maintscript-helper(1)

##
## Functions to remove an obsolete conffile during upgrade
##
rm_conffile() {
  local CONFFILE="$1"
  local LASTVERSION="$2"
  local PACKAGE="$3"

  if [ "$LASTVERSION" = "--" ]; then
    LASTVERSION=""
    PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
  fi
  if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
    PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
  fi
  # Skip remaining parameters up to --
  while [ "$1" != "--" -a $# -gt 0 ]; do
    shift
  done
  [ $# -gt 0 ] || badusage "missing arguments after --"
  shift

  [ -n "$PACKAGE" ] || error "couldn't identify the package"
  [ -n "$1" ] || error "maintainer script parameters are missing"
  [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
    error "environment variable DPKG_MAINTSCRIPT_NAME is required"
  [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
    error "environment variable DPKG_MAINTSCRIPT_PACKAGE is required"
  [ "${CONFFILE}" != "${CONFFILE#/}" ] || \
    error "conffile '$CONFFILE' is not an absolute path"
  validate_optional_version "$LASTVERSION"

  debug "Executing $0 rm_conffile in $DPKG_MAINTSCRIPT_NAME" \
        "of $DPKG_MAINTSCRIPT_PACKAGE"
  debug "CONFFILE=$CONFFILE PACKAGE=$PACKAGE" \
        "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
  case "$DPKG_MAINTSCRIPT_NAME" in
  preinst)
    if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] &&
       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
      prepare_rm_conffile "$CONFFILE" "$PACKAGE"
    fi
    ;;
  postinst)
    if [ "$1" = "configure" ] && [ -n "$2" ] &&
       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
      finish_rm_conffile "$CONFFILE"
    fi
    ;;
  postrm)
    if [ "$1" = "purge" ]; then
      rm -f "$DPKG_ROOT$CONFFILE.dpkg-bak" \
            "$DPKG_ROOT$CONFFILE.dpkg-remove" \
            "$DPKG_ROOT$CONFFILE.dpkg-backup"
    fi
    if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
       [ -n "$2" ] &&
       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
      abort_rm_conffile "$CONFFILE" "$PACKAGE"
    fi
    ;;
  *)
    debug "$0 rm_conffile not required in $DPKG_MAINTSCRIPT_NAME"
    ;;
  esac
}

prepare_rm_conffile() {
  local CONFFILE="$1"
  local PACKAGE="$2"

  [ -e "$DPKG_ROOT$CONFFILE" ] || return 0
  ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0

  local md5sum old_md5sum
  md5sum="$(md5sum "$DPKG_ROOT$CONFFILE" | sed -e 's/ .*//')"
  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
    sed -n -e "\\'^ $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
  if [ "$md5sum" != "$old_md5sum" ]; then
    mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-backup"
  else
    mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-remove"
  fi
}

finish_rm_conffile() {
  local CONFFILE="$1"

  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-backup"