<commit_before>#!/bin/bash

# rootpy account at www.copy.com
CLOUD=~/Copy/ci/root_builds

if [ ! -e $CLOUD ]; then
    echo "first mount dropbox at ${CLOUD}"
    exit 1
fi

PYTHON=2.7
BASE=${HOME}/software/root/ # leave the trailing / here
if [ ! -e $BASE ]; then
    mkdir -p $BASE
fi

if [ ! -e tags.lst ]; then
    echo "list the tags, one per line in tags.lst"
    exit 1
fi

cp tags.lst $BASE

cd $BASE
if [ ! -e root ]; then
    git clone http://root.cern.ch/git/root.git || exit 1
fi

while read ROOT;
do
    if [ -e ${CLOUD}/root_${ROOT}_python_${PYTHON}.tar.gz ]; then
        echo "${CLOUD}/root_${ROOT}_python_${PYTHON}.tar.gz already exists"
        continue
    fi
    
    echo "building $ROOT ..."

    cd root
    make clean
    git checkout master
    git branch -D $ROOT
    git checkout -b $ROOT $ROOT
    ./configure --enable-python --enable-roofit --enable-xml --enable-tmva --disable-xrootd --fail-on-missing || exit 1
    make -j 4 || exit 1
    export ROOTSYS=root_${ROOT}_python_${PYTHON}
    make DESTDIR=$BASE install || exit 1
    cd ..

    tar zcvf root_${ROOT}_python_${PYTHON}.tar.gz root_${ROOT}_python_${PYTHON}
    mv root_${ROOT}_python_${PYTHON}.tar.gz $CLOUD

done < tags.lst<commit_msg>clean the root repo before making a new build for travis<commit_after>#!/bin/bash

# rootpy account at www.copy.com
CLOUD=~/Copy/ci/root_builds

if [ ! -e $CLOUD ]; then
    echo "first mount dropbox at ${CLOUD}"
    exit 1
fi

PYTHON=2.7
BASE=${HOME}/software/root/ # leave the trailing / here
if [ ! -e $BASE ]; then
    mkdir -p $BASE
fi

if [ ! -e tags.lst ]; then
    echo "list the tags, one per line in tags.lst"
    exit 1
fi

cp tags.lst $BASE

cd $BASE
if [ ! -e root ]; then
    git clone http://root.cern.ch/git/root.git || exit 1
fi

while read ROOT;
do
    if [ -e ${CLOUD}/root_${ROOT}_python_${PYTHON}.tar.gz ]; then
        echo "${CLOUD}/root_${ROOT}_python_${PYTHON}.tar.gz already exists"
        continue
    fi
    
    echo "building $ROOT ..."

    cd root
    make clean
    git checkout master
    git clean -f -x -d
    git branch -D $ROOT
    git checkout -b $ROOT $ROOT
    ./configure --enable-python --enable-roofit --enable-xml --enable-tmva --disable-xrootd --fail-on-missing || exit 1
    make -j 4 || exit 1
    export ROOTSYS=root_${ROOT}_python_${PYTHON}
    make DESTDIR=$BASE install || exit 1
    cd ..

    tar zcvf root_${ROOT}_python_${PYTHON}.tar.gz root_${ROOT}_python_${PYTHON}
    mv root_${ROOT}_python_${PYTHON}.tar.gz $CLOUD

done < tags.lst
{'fraction_non_alphanumeric': 0.14348171701112877, 'fraction_numerical': 0.007154213036565978, 'mean_word_length': 2.642547033285094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5249006', 'n_tokens_mistral': 942, 'n_tokens_neox': 915, 'n_words': 270}