#!/bin/sh USAGE="USAGE: lt.clone-langtools.sh [depth]\n\ \t\t identifies the mercurial consolidated repo (i.e. 'https://github.com/Project-Skara/jdk.git')\n\ \t\t is the folder in which the repo is cloned\n\ \t\t is the (optional) history depth\n" DEPTH_OPT="" if [ "x$1" = "x" ]; then echo -e $USAGE exit 1 fi if [ "x$2" = "x" ]; then echo -e $USAGE exit 1 fi if [ "x$3" != "x" ]; then DEPTH_OPT="--depth $3" fi mkdir $2 cd $2 git init git config core.sparseCheckout true echo "make/langtools" >> .git/info/sparse-checkout echo "src/jdk.compiler" >> .git/info/sparse-checkout echo "src/java.compiler" >> .git/info/sparse-checkout echo "src/jdk.javadoc" >> .git/info/sparse-checkout echo "src/jdk.jdeps" >> .git/info/sparse-checkout echo "src/jdk.jshell" >> .git/info/sparse-checkout echo "test/langtools" >> .git/info/sparse-checkout git remote add origin $1 git pull origin master $DEPTH_OPT cd ..