<commit_before>#!/bin/bash -e

RELEASE=`lsb_release -r|awk '{print $2}'`

sudo apt-get install -y gdebi-core
if [ "$RELEASE" = "14.04" ]; then
    if [ ! -f build/antlr3_3.5.2-1_all.deb ]; then
        rm -rf build/antlr3-3.5.2
        mkdir -p build/antlr3-3.5.2
        cp -a dist/ubuntu/dep/antlr3-3.5.2/* build/antlr3-3.5.2
        cd build/antlr3-3.5.2
        wget http://www.antlr3.org/download/antlr-3.5.2-complete-no-st3.jar
        echo Y | sudo mk-build-deps -i -r
        debuild -r fakeroot --no-tgz-check -us -uc
        cd -
    fi
fi

if [ ! -f build/antlr3-c++-dev_3.5.2-1_all.deb ]; then
    rm -rf build/antlr3-c++-dev-3.5.2
    if [ ! -f build/3.5.2.tar.gz ]; then
        wget -O build/3.5.2.tar.gz https://github.com/antlr/antlr3/archive/3.5.2.tar.gz
    fi
    cd build
    tar xpf 3.5.2.tar.gz
    mv antlr3-3.5.2 antlr3-c++-dev-3.5.2
    cd -
    cp -a dist/ubuntu/dep/antlr3-c++-dev-3.5.2/debian build/antlr3-c++-dev-3.5.2
    cd build/antlr3-c++-dev-3.5.2
    echo Y | sudo mk-build-deps -i -r
    debuild -r fakeroot --no-tgz-check -us -uc
    cd -
fi

if [ ! -f build/libthrift0_1.0.0-dev_amd64.deb ]; then
    rm -rf build/thrift-0.9.1
    if [ ! -f build/thrift-0.9.1.tar.gz ]; then
        wget -O build/thrift-0.9.1.tar.gz http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz
    fi
    cd build
    tar xpf thrift-0.9.1.tar.gz
    cd thrift-0.9.1
    patch -p0 < ../../dist/ubuntu/dep/thrift.diff
    echo Y | sudo mk-build-deps -i -r
    debuild -r fakeroot --no-tgz-check -us -uc
    cd ../..
fi

if [ "$RELEASE" = "14.04" ]; then
    sudo gdebi -n build/antlr3_*.deb
    sudo gdebi -n build/thrift-compiler_*.deb
fi
sudo gdebi -n build/antlr3-c++-dev_*.deb
sudo gdebi -n build/libthrift0_*.deb
sudo gdebi -n build/libthrift-dev_*.deb<commit_msg>dist/ubuntu/dep: Drop python-support on Ubuntu 16.04<commit_after>#!/bin/bash -e

RELEASE=`lsb_release -r|awk '{print $2}'`

sudo apt-get install -y gdebi-core
if [ "$RELEASE" = "14.04" ]; then
    if [ ! -f build/antlr3_3.5.2-1_all.deb ]; then
        rm -rf build/antlr3-3.5.2
        mkdir -p build/antlr3-3.5.2
        cp -a dist/ubuntu/dep/antlr3-3.5.2/* build/antlr3-3.5.2
        cd build/antlr3-3.5.2
        wget http://www.antlr3.org/download/antlr-3.5.2-complete-no-st3.jar
        echo Y | sudo mk-build-deps -i -r
        debuild -r fakeroot --no-tgz-check -us -uc
        cd -
    fi
fi

if [ ! -f build/antlr3-c++-dev_3.5.2-1_all.deb ]; then
    rm -rf build/antlr3-c++-dev-3.5.2
    if [ ! -f build/3.5.2.tar.gz ]; then
        wget -O build/3.5.2.tar.gz https://github.com/antlr/antlr3/archive/3.5.2.tar.gz
    fi
    cd build
    tar xpf 3.5.2.tar.gz
    mv antlr3-3.5.2 antlr3-c++-dev-3.5.2
    cd -
    cp -a dist/ubuntu/dep/antlr3-c++-dev-3.5.2/debian build/antlr3-c++-dev-3.5.2
    cd build/antlr3-c++-dev-3.5.2
    echo Y | sudo mk-build-deps -i -r
    debuild -r fakeroot --no-tgz-check -us -uc
    cd -
fi

if [ ! -f build/libthrift0_1.0.0-dev_amd64.deb ]; then
    rm -rf build/thrift-0.9.1
    if [ ! -f build/thrift-0.9.1.tar.gz ]; then
        wget -O build/thrift-0.9.1.tar.gz http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz
    fi
    cd build
    tar xpf thrift-0.9.1.tar.gz
    cd thrift-0.9.1
    patch -p0 < ../../dist/ubuntu/dep/thrift.diff
    if [ "$RELEASE" = "16.04" ]; then
        sed -i "s/, python-support//" debian/control
        sed -i "s/dh_pysupport//" debian/rules
    fi
    echo Y | sudo mk-build-deps -i -r
    debuild -r fakeroot --no-tgz-check -us -uc
    cd ../..
fi

if [ "$RELEASE" = "14.04" ]; then
    sudo gdebi -n build/antlr3_*.deb
    sudo gdebi -n build/thrift-compiler_*.deb
fi
sudo gdebi -n build/antlr3-c++-dev_*.deb
sudo gdebi -n build/libthrift0_*.deb
sudo gdebi -n build/libthrift-dev_*.deb
{'fraction_non_alphanumeric': 0.18010610079575598, 'fraction_numerical': 0.06153846153846154, 'mean_word_length': 1.894090560245587, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '911244', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1715, 'n_words': 334}