#!/usr/bin/env bash

## What do we want ?
VERSION=$(cat package-version.txt | sed -re "s/^(.*)\\.p.+$/\\1/")
TARGET_TARBALL=r-$VERSION.tar.gz
SOURCE_TARBALL=R-$VERSION.tar.gz

set -e

wget http://cran.r-project.org/src/base/R-3/$SOURCE_TARBALL
mv $SOURCE_TARBALL $SAGE_ROOT/upstream/$TARGET_TARBALL

sage -sh 'sage-fix-pkg-checksums'
