<commit_before>#!/usr/bin/env bash
root=$(readlink -e $(dirname $0))
set -e
if [ "x" == "x$root" ] ; then
    root=$PWD/${0##*}
fi
cd $root

tags=""

help_text="usage: $0 [--disable-redis]"

# check for help flags first
for arg in $@ ; do
    case $arg in
        -h|--help)
            echo $help_text
            exit 0
            ;;
    esac
done

rev="<KEY>"
ipfs="no"
_next=""
# check for build flags
for arg in $@ ; do
    case $arg in
        "--ipfs")
            ipfs="yes"
            ;;
        "--disable-redis")
            tags="$tags -tags disable_redis"
            ;;
        "--revision")
            _next="rev"
            ;;
        "--revision=*")
            rev=$(echo $arg | cut -d'=' -f2)
            ;;
        *)
            if [ "x$_next" == "xrev" ] ; then
                rev="$arg"
            fi
    esac
done

if [ "x$rev" == "x" ] ; then
    echo "revision not specified"
    exit 1
fi

cd $root
unset GOPATH 
export GOPATH=$PWD/go
mkdir -p $GOPATH

if [ "x$ipfs" == "xyes" ] ; then
    echo "obtaining gx"
    go get -u -v github.com/whyrusleeping/gx-go
    mkdir -p vendor/gx/ipfs
    cd vendor/gx/ipfs
    $GOPATH/bin/gx get $rev
    cd $root
    $GOPATH/bin/gx install
    go build
    cp nntpchan srndv2
else<commit_msg>only obtain gx if we do not have it<commit_after>#!/usr/bin/env bash
root=$(readlink -e $(dirname $0))
set -e
if [ "x" == "x$root" ] ; then
    root=$PWD/${0##*}
fi
cd $root

tags=""

help_text="usage: $0 [--disable-redis]"

# check for help flags first
for arg in $@ ; do
    case $arg in
        -h|--help)
            echo $help_text
            exit 0
            ;;
    esac
done

rev="<KEY>"
ipfs="no"
_next=""
# check for build flags
for arg in $@ ; do
    case $arg in
        "--ipfs")
            ipfs="yes"
            ;;
        "--disable-redis")
            tags="$tags -tags disable_redis"
            ;;
        "--revision")
            _next="rev"
            ;;
        "--revision=*")
            rev=$(echo $arg | cut -d'=' -f2)
            ;;
        *)
            if [ "x$_next" == "xrev" ] ; then
                rev="$arg"
            fi
    esac
done

if [ "x$rev" == "x" ] ; then
    echo "revision not specified"
    exit 1
fi

cd $root
unset GOPATH 
export GOPATH=$PWD/go
mkdir -p $GOPATH

if [ "x$ipfs" == "xyes" ] ; then
    if [ ! -e $GOPATH/bin/gx ] ; then
        echo "obtaining gx"
        go get -u -v github.com/whyrusleeping/gx-go
    fi
    mkdir -p vendor/gx/ipfs
    cd vendor/gx/ipfs
    $GOPATH/bin/gx get $rev
    cd $root
    $GOPATH/bin/gx install
    go build
    cp nntpchan srndv2
else
{'fraction_non_alphanumeric': 0.1555641124374278, 'fraction_numerical': 0.005390835579514825, 'mean_word_length': 1.5748265609514371, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3029343', 'n_tokens_mistral': 1002, 'n_tokens_neox': 961, 'n_words': 262}