#!/bin/bash -ex

VERSION=$1

if [ "$VERSION" == "" ]; then
    echo "Usage: $0 <version of packages>"
    exit 1
fi

apt-get update

apt-get install --force-yes -y -o Dpkg::Options::=--force-confnew \
    yandex-direct=$VERSION \
    yandex-direct-conf-dev=$VERSION \
    yandex-direct-deploy=$VERSION \
    yandex-direct-dpkg-monitor-configs=$VERSION \
    yandex-direct-fake-services=$VERSION \
    yandex-direct-file-storage-server=$VERSION \
    yandex-direct-frontend=$VERSION \
    yandex-direct-funcs-gearman-workers=$VERSION \
    yandex-direct-gearmand=$VERSION \
    yandex-direct-intapi=$VERSION \
    yandex-direct-internal-networks=$VERSION \
    yandex-direct-juggler-checks=$VERSION \
    yandex-direct-memcached-ppc=$VERSION \
    yandex-direct-monitoring=$VERSION \
    yandex-direct-nginx-geo-configs=$VERSION \
    yandex-direct-push-client-config=$VERSION \
    yandex-direct-resource-yacatalog=$VERSION \
    yandex-direct-sandbox-zk-delivery-configs=$VERSION \
    yandex-direct-soap=$VERSION \
    yandex-direct-user=$VERSION \
    yandex-direct-zk-delivery-configs=$VERSION \
    yandex-direct-zookeeper-ppc=$VERSION
