diff options
author | Roger Leigh <rleigh@debian.org> | 2006-06-14 09:29:42 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2006-06-14 09:29:42 +0000 |
commit | ff93e912e6fe1db8cc4e89a828bbe5b6f59dc8e8 (patch) | |
tree | 2896786ca6d29535e19a9e19e249677d2a3199ac /debian/schroot.preinst | |
parent | 75799342be4273f099444c07951d8ad03b74d49f (diff) | |
download | schroot-ff93e912e6fe1db8cc4e89a828bbe5b6f59dc8e8.tar.gz |
* debian/changelog: Split dchroot into a separate package.
Diffstat (limited to 'debian/schroot.preinst')
-rw-r--r-- | debian/schroot.preinst | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/schroot.preinst b/debian/schroot.preinst new file mode 100644 index 00000000..13504d30 --- /dev/null +++ b/debian/schroot.preinst @@ -0,0 +1,43 @@ +#! /bin/sh +# preinst script for schroot +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> + +# Prepare to move a conffile without triggering a dpkg question +prep_mv_conffile() { + CONFFILE="$1" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`" + if [ "$md5sum" = "$old_md5sum" ]; then + rm -f "$CONFFILE" + fi + fi +} + +case "$1" in +install|upgrade) + if dpkg --compare-versions "$2" le "0.1.4-1"; then + prep_mv_conffile "/etc/schroot.conf" + fi + if dpkg --compare-versions "$2" le "0.2.6-1"; then + prep_mv_conffile "/etc/schroot/run.d/50sbuild" + prep_mv_conffile "/etc/schroot/run.d/00check" + fi +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 |