#!/bin/bash

GROUP=$2
SOURCE=$1

if [ "x${SOURCE}" = "x" ]; then
    echo "Need a source package"
    exit 1
fi

if [ "x${GROUP}" = "x" ]; then
    echo "Need a group ID"
    exit 1
fi

VERSION=$(apt-cache showsrc ${SOURCE} | grep '^Version:' | awk '{print $2}')
echo "uploading ${SOURCE}/${VERSION} for unstable"
ricky-upload --dist=unstable --source=${SOURCE} --version=${VERSION} \
    --group=${GROUP}
