X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=debian%2Fpreinst;h=848ecfff44f011e24d25289d8f6fae15894e6571;hb=b285a6913f2b2f80d51d70b57bfe0a659903e2e2;hp=43ccd683bad8be58eca80e3874a953d89b855818;hpb=08f61f2b8ff41f131e4d71dccfeddc7cd27474a0;p=grml-etc-core.git diff --git a/debian/preinst b/debian/preinst index 43ccd68..848ecff 100755 --- a/debian/preinst +++ b/debian/preinst @@ -4,7 +4,7 @@ # 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: Die Okt 03 20:33:19 CEST 2006 [mika] +# Latest change: Fre Feb 09 15:24:01 CET 2007 [mika] ################################################################################ set -e @@ -18,21 +18,24 @@ divert_conffile() { cp -f "$CONFFILE" "$CONFFILE".original else [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".grml-etc-core -# [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".original fi + } case "$1" in install|upgrade|configure) + TMP=$$ # move files from package grml-etc to grml-etc-core, make sure # we don't lose any files... 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.$$" divert_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" [ -f "$file".grml-etc-core ] && mv -f "$file".grml-etc-core "$file" + [ -e "${file}.tmp.$$" ] && mv -f "${file}.tmp.$$" "$file.original" # trying to overwrite `/etc/skel/.zshrc', which is also in package zsh # [ -f /etc/skel/.zshrc ] && \