#!/bin/sh

set -e

VER="__NEW_VERSION__"
base_dir="/usr/lib"

case "$1" in
  configure)
    update-alternatives --install /usr/bin/juju juju $base_dir/juju-$VER/bin/juju 30 \
      --slave /usr/bin/jujud jujud $base_dir/juju-$VER/bin/jujud \
      --slave /usr/share/man/man1/juju.1 juju.1 $base_dir/juju-$VER/man/man1/juju.1 \
      --slave /usr/bin/juju-metadata juju-metadata $base_dir/juju-$VER/bin/juju-metadata \
      --slave /usr/bin/juju-restore juju-restore $base_dir/juju-$VER/bin/juju-restore \
      --slave /usr/bin/juju-backup juju-backup $base_dir/juju-$VER/bin/juju-backup
    ;;
  abort-upgrade|abort-remove|abort-deconfigure)
    ;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
    exit 0
    ;;
esac

#DEBHELPER#

exit 0
