<commit_before>#!/usr/bin/bash

#Install BDB
echo Installing BDB  if necessary ...
if ! test -d /usr/local/BerkeleyDB.4.6 ; then
    (
        echo "BDB is missing.  Downloading from svn" &&
        cd /usr/local &&
        svn co -q https://svn.tokutek.com/tokudb/berkeleydb/windows/amd64/BerkeleyDB.4.6
    ) || { echo Failed; exit 1; }
fi
if ! grep 'export BDB=' ~/.bashrc > /dev/null; then
    echo "Adding 'export BDB=/usr/local/BerkeleyDB.4.6' to ~/.bashrc"
    echo 'export BDB=/usr/local/BerkeleyDB.4.6' >> ~/.bashrc
fi
if ! grep 'export BDBDIR=' ~/.bashrc > /dev/null; then
    echo "Adding 'export BDBDIR=C:/cygwin/usr/local/BerkeleyDB.4.6'' to ~/.bashrc"
    echo 'export BDBDIR=C:/cygwin/usr/local/BerkeleyDB.4.6' >> ~/.bashrc
fi
echo Done installing BDB.
echo 


#Install licenses.
if ! test -e ../licenses/install_licenses_amd64.bat; then
    echo Missing ../licenses directory.
    exit 1
fi
echo Installing licenses...
(cd ../licenses && cmd /c install_licenses_amd64.bat) > /dev/null
echo Done installing licenses.
echo


#install icc integration
(
    cd amd64 &&
    if ! diff -q Cygwin.bat /cygdrive/c/cygwin/Cygwin.bat > /dev/null; then
        cp Cygwin.bat /cygdrive/c/cygwin/
    fi
)
if ! grep 'export CC=' ~/.bashrc > /dev/null; then
    echo "Adding 'export CC=icc' to ~/.bashrc"
    echo 'export CC=icc' >> ~/.bashrc
fi
if ! grep 'export CYGWIN=' ~/.bashrc > /dev/null; then
    echo "Adding 'export CYGWIN=CYGWIN' to ~/.bashrc"
    echo 'export CYGWIN=CYGWIN' >> ~/.bashrc
fi

#cygwin link is in the way
if test -e /usr/bin/link; then
    mv /usr/bin/link /usr/bin/link_DISABLED
fi
#cygwin cmake is in the way
if test -e /usr/bin/cmake; then
    mv /usr/bin/cmake /usr/bin/cmake_DISABLED
fi

#Set up aliases
( cd amd64/symlinks && cp -d * /usr/local/bin/ )

#Copy nightly script.
cp -u nightly.sh ~/


echo You can now install the intel compiler.
echo You must restart cygwin after intel compiler is installed.
echo If the intel compiler is already installed, just restart cygwin.

echo

<commit_msg>Made script more robust.<commit_after>#!/usr/bin/bash

#Install BDB
echo Installing BDB  if necessary ...
if ! test -d /usr/local/BerkeleyDB.4.6 ; then
    (
        echo "BDB is missing.  Downloading from svn" &&
        cd /usr/local &&
        svn co -q https://svn.tokutek.com/tokudb/berkeleydb/windows/amd64/BerkeleyDB.4.6
    ) || { echo Failed; exit 1; }
fi
if ! grep 'export BDB=' ~/.bashrc > /dev/null; then
    echo "Adding 'export BDB=/usr/local/BerkeleyDB.4.6' to ~/.bashrc"
    echo 'export BDB=/usr/local/BerkeleyDB.4.6' >> ~/.bashrc
fi
if ! grep 'export BDBDIR=' ~/.bashrc > /dev/null; then
    echo "Adding 'export BDBDIR=C:/cygwin/usr/local/BerkeleyDB.4.6'' to ~/.bashrc"
    echo 'export BDBDIR=C:/cygwin/usr/local/BerkeleyDB.4.6' >> ~/.bashrc
fi
echo Done installing BDB.
echo 


#Install licenses.
if ! test -e ../licenses/install_licenses_amd64.bat; then
    echo Missing ../licenses directory.
    exit 1
fi
echo Installing licenses...
(cd ../licenses && cmd /c install_licenses_amd64.bat) > /dev/null
echo Done installing licenses.
echo


#install icc integration
(
    cd amd64 &&
    if ! diff -q Cygwin.bat /cygdrive/c/cygwin/Cygwin.bat > /dev/null; then
        cp Cygwin.bat /cygdrive/c/cygwin/ || { echo Failed Cygwin.bat; exit 1; }
    fi
)
if ! grep 'export CC=' ~/.bashrc > /dev/null; then
    echo "Adding 'export CC=icc' to ~/.bashrc"
    echo 'export CC=icc' >> ~/.bashrc
fi
if ! grep 'export CYGWIN=' ~/.bashrc > /dev/null; then
    echo "Adding 'export CYGWIN=CYGWIN' to ~/.bashrc"
    echo 'export CYGWIN=CYGWIN' >> ~/.bashrc
fi

#cygwin link is in the way
if test -e /usr/bin/link; then
    mv /usr/bin/link /usr/bin/link_DISABLED || { echo Failed changing link; exit 1; }
fi
#cygwin cmake is in the way
if test -e /usr/bin/cmake; then
    mv /usr/bin/cmake /usr/bin/cmake_DISABLED || { echo Failed changing link; exit 1; }
fi

#Set up aliases
( cd amd64/symlinks && cp -d * /usr/local/bin/  || { echo Failed copying link; exit 1; } )

#Copy nightly script.
cp -u nightly.sh ~/ || { echo Failed copying nightly.sh; exit 1; }


echo You can now install the intel compiler.
echo You must restart cygwin after intel compiler is installed.
echo If the intel compiler is already installed, just restart cygwin.

echo


{'fraction_non_alphanumeric': 0.13945339873861248, 'fraction_numerical': 0.012380284980144826, 'mean_word_length': 2.871609403254973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6323370', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1580, 'n_words': 484}