From ccbb261ab37df12e5367406c9faa933f726f5443 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 21 Mar 2007 19:04:10 +0100 Subject: [PATCH] Another version of dpkg-divert handling for debian/preinst. --- debian/changelog | 6 ++++++ debian/preinst | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index cb04c20..1deff23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml-etc-core (0.2.36) unstable; urgency=low + + * Another version of dpkg-divert handling for debian/preinst. + + -- Michael Prokop Wed, 21 Mar 2007 19:03:38 +0100 + grml-etc-core (0.2.35) unstable; urgency=low * /etc/zsh/zshrc: added aliases for better iso<->utf handling: diff --git a/debian/preinst b/debian/preinst index dc28a6e..64f5164 100755 --- a/debian/preinst +++ b/debian/preinst @@ -4,20 +4,20 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Mär 03 18:16:47 CET 2007 [mika] +# Latest change: Mit Mär 21 19:03:31 CET 2007 [mika] ################################################################################ set -e # check for files from rm_conffile() in debian/preinst of grml-etc # make sure we don't lose any files... -divert_conffile() { +backup_conffile() { CONFFILE="$1" if [ -e "$CONFFILE.dpkg-bak" -a -e "$CONFFILE" ]; then cp -f "$CONFFILE" "$CONFFILE".original else - [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".grml-etc-core + [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".grml-etc-core || true fi } @@ -29,7 +29,7 @@ case "$1" in for file in /etc/zsh/zlogin /etc/zsh/zprofile /etc/zsh/zshenv /etc/zsh/zshrc \ /etc/zsh/zlogout /etc/vim/vimrc; do [ -e "$file".original ] || cp -f "$file" "${file}.tmp.$$" || /bin/true - divert_conffile $file && \ + backup_conffile $file && \ [ -f "$file" ] && rm $file && \ dpkg-divert --quiet --add --rename --package grml-etc-core --divert "$file".original $file && \ [ -f "$file".dpkg-bak ] && mv -f "$file".dpkg-bak "$file" -- 2.1.4