#!/bin/bash

VERSION=$2
FILE=$3

SVERSION=`echo $VERSION | tr -d "."`

# The file isn't the real file, but we've been given the version number
# we need to get.

rm -f $FILE

echo "Fetching mercurial repository and extracting version $VERSION"

hg clone http://hg.netbeans.org/main/nb-javac/
cd nb-javac
hg archive -t tgz -r release${SVERSION}_base ../../libnb-javaparser-java_${VERSION}.orig.tar.gz
cd ../
rm -rf nb-javac

