aegir2-provision.preinst 1.43 KB
Newer Older
anarcat's avatar
anarcat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh
# preinst script for aegir-provision
#
# 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>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

16
VARLIB=/var/aegir
anarcat's avatar
anarcat committed
17 18 19 20 21

case "$1" in
    install|upgrade)
        # DEPRECATED: drush_make package dependency introduced in 1.5,
        # compatibility code should be removed in ... 3.x?
22
        if [ -d $VARLIB/.drush/drush_make ]; then
23 24 25 26
            echo "existing drush_make install in $VARLIB/.drush/drush_make detected"
            echo "this needs to be removed or moved away for the install to be completed"
            echo "try: rm -rf $VARLIB/.drush/drush_make"
            exit 1
anarcat's avatar
anarcat committed
27
        fi
28
        if [ -d $VARLIB/.drush/provision ]; then
29
            echo "existing provision install in $VARLIB/.drush/provision detected"
30 31 32 33 34
            echo "this needs to be removed or moved away for the install to be completed"
            echo "try: rm -rf $VARLIB/.drush/provision"
            exit 1
        fi

anarcat's avatar
anarcat committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0