Jiri Vanek work 2ec2365
#!/bin/bash
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
set -e
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
VERSION=$1
Jiri Vanek work 2ec2365
JDK8_URL=http://hg.openjdk.java.net
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
if test "x${VERSION}" = "x"; then
Jiri Vanek work 2ec2365
    echo "No version specified. A version is of the form 'jdk8-bXX' (such as 'jdk8-b79')"
Jiri Vanek work 2ec2365
    exit -1;
Jiri Vanek work 2ec2365
fi
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
#for REPO_NAME in jdk8 aarch64-port
Jiri Vanek work 2ec2365
for REPO_NAME in aarch64-port
Jiri Vanek work 2ec2365
do
Jiri Vanek work 2ec2365
    mkdir ${REPO_NAME}
Jiri Vanek work 2ec2365
    pushd ${REPO_NAME}
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
    REPO_ROOT=${JDK8_URL}/${REPO_NAME}/jdk8
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
    if [[ "$REPO_NAME" == "aarch64-port" ]] ; then
Jiri Vanek work 2ec2365
        # aarch64-port does not tag trees
Jiri Vanek work 2ec2365
        # FIXME make this clone reproducible
Jiri Vanek work 2ec2365
        hg clone ${REPO_ROOT} -r ${VERSION}
Jiri Vanek work 2ec2365
    else
Jiri Vanek work 2ec2365
        hg clone ${REPO_ROOT} -r ${VERSION}
Jiri Vanek work 2ec2365
    fi
Jiri Vanek work 2ec2365
    pushd jdk8
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
#    for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn common
Jiri Vanek work 2ec2365
#    it looks like commons have been added as separate repo for jdk8
Jiri Vanek work 2ec2365
#    but not yet for aarch64-port
Jiri Vanek work 2ec2365
    for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn
Jiri Vanek work 2ec2365
    do
Jiri Vanek work 2ec2365
        if [[ "$REPO_NAME" == "aarch64-port" ]] ; then
Jiri Vanek work 2ec2365
            # aarch64-port does not tag trees
Jiri Vanek work 2ec2365
            # FIXME make this clone reproducible
Jiri Vanek bfb56cf
            hg clone ${REPO_ROOT}/${subrepo} -r ${VERSION}
Jiri Vanek work 2ec2365
        else
Jiri Vanek work 2ec2365
            hg clone ${REPO_ROOT}/${subrepo} -r ${VERSION}
Jiri Vanek work 2ec2365
        fi
Jiri Vanek work 2ec2365
    done
Jiri Vanek work 2ec2365
    rm -rvf jdk/src/share/native/sun/security/ec/impl || echo ok
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
    popd
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
    find jdk8 -type d -name ".hg" -exec rm -rf '{}' \; || echo ok
Jiri Vanek work 2ec2365
    tar cJf ${REPO_NAME}-${VERSION}.tar.xz jdk8
Jiri Vanek work 2ec2365
Jiri Vanek work 2ec2365
    popd
Jiri Vanek work 2ec2365
done
Jiri Vanek work 2ec2365