<commit_before>#!/bin/sh

set -e
set -x

# for building documentation
pip install sphinx

if test -n "$USEPY"; then
  # need to launch tests.appmanager with a more modern python.
  # doing this for 2.4 and 2.5 now.
  pip install -r requirements-dev.txt --use-mirrors
  
  # https://launchpad.net/~fkrull/+archive/deadsnakes
  # http://askubuntu.com/questions/304178/how-do-i-add-a-ppa-in-a-shell-script-without-user-input
  sudo add-apt-repository -y ppa:fkrull/deadsnakes
  sudo apt-get update
  sudo apt-get install python$USEPY-dev
  mkdir archives && (
    cd archives &&
    wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.1.2.tar.gz &&
    tar zxf virtualenv-1.7.1.2.tar.gz &&
    cd virtualenv-1.7.1.2 &&
    sudo python$USEPY setup.py install
  )
  virtualenv --version
  which virtualenv
  # travis places its virtualenv in /usr/local/bin.
  # virtualenv 1.7 installed above for python 2.x goes in /usr/bin.
  # /usr/local/bin is earlier in path and takes precedence.
  # manually invoke the 1.7 version here.
  # however, when installed for 2.x our virtualenv 1.7 goes in /usr/local/bin.
  if test "$USEPY" = 3.1; then
    virtualenv=/usr/local/bin/virtualenv
  else
    virtualenv=/usr/bin/virtualenv
  fi
  $virtualenv --version
  $virtualenv ~/virtualenv/python$USEPY -p python$USEPY
  . ~/virtualenv/python$USEPY/bin/activate
  python -V
  which pip
  pip --version
fi

if test -e requirements-dev-$USEPY.txt; then
  pip install -r requirements-dev-$USEPY.txt --use-mirrors
else
  pip install -r requirements-dev.txt --use-mirrors
fi

if test "$USEPY" = 2.4; then
  # patch nose
  sed -i -e s/BaseException/Exception/ ~/virtualenv/python2.4/lib/python2.4/site-packages/nose/failure.py
fi

if test -n "$USECURL"; then
  wget "http://curl.haxx.se/download/curl-$USECURL.tar.gz"
  if test -n "$USESSL"; then
    sudo apt-get update
    case "$USESSL" in
    openssl)
      sudo apt-get install libssl-dev
      configure_flags="--with-ssl --without-gnutls --without-nss"
      ;;
    libressl)
      wget http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$USELIBRESSL.tar.gz
      tar xfz libressl-$USELIBRESSL.tar.gz
      (cd libressl-$USELIBRESSL &&
        ./configure --prefix=/opt/libressl-$USELIBRESSL &&
        make &&
        sudo make install)
      configure_flags="--with-ssl=/opt/libressl-$USELIBRESSL --without-gnutls --without-nss"<commit_msg>Fetch old libcurl releases from archeology subdir<commit_after>#!/bin/sh

set -e
set -x

# for building documentation
pip install sphinx

if test -n "$USEPY"; then
  # need to launch tests.appmanager with a more modern python.
  # doing this for 2.4 and 2.5 now.
  pip install -r requirements-dev.txt --use-mirrors
  
  # https://launchpad.net/~fkrull/+archive/deadsnakes
  # http://askubuntu.com/questions/304178/how-do-i-add-a-ppa-in-a-shell-script-without-user-input
  sudo add-apt-repository -y ppa:fkrull/deadsnakes
  sudo apt-get update
  sudo apt-get install python$USEPY-dev
  mkdir archives && (
    cd archives &&
    wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.1.2.tar.gz &&
    tar zxf virtualenv-1.7.1.2.tar.gz &&
    cd virtualenv-1.7.1.2 &&
    sudo python$USEPY setup.py install
  )
  virtualenv --version
  which virtualenv
  # travis places its virtualenv in /usr/local/bin.
  # virtualenv 1.7 installed above for python 2.x goes in /usr/bin.
  # /usr/local/bin is earlier in path and takes precedence.
  # manually invoke the 1.7 version here.
  # however, when installed for 2.x our virtualenv 1.7 goes in /usr/local/bin.
  if test "$USEPY" = 3.1; then
    virtualenv=/usr/local/bin/virtualenv
  else
    virtualenv=/usr/bin/virtualenv
  fi
  $virtualenv --version
  $virtualenv ~/virtualenv/python$USEPY -p python$USEPY
  . ~/virtualenv/python$USEPY/bin/activate
  python -V
  which pip
  pip --version
fi

if test -e requirements-dev-$USEPY.txt; then
  pip install -r requirements-dev-$USEPY.txt --use-mirrors
else
  pip install -r requirements-dev.txt --use-mirrors
fi

if test "$USEPY" = 2.4; then
  # patch nose
  sed -i -e s/BaseException/Exception/ ~/virtualenv/python2.4/lib/python2.4/site-packages/nose/failure.py
fi

if test -n "$USECURL"; then
  wget "http://curl.haxx.se/download/curl-$USECURL.tar.gz" ||
    wget "http://curl.haxx.se/download/archeology/curl-$USECURL.tar.gz"
  if test -n "$USESSL"; then
    sudo apt-get update
    case "$USESSL" in
    openssl)
      sudo apt-get install libssl-dev
      configure_flags="--with-ssl --without-gnutls --without-nss"
      ;;
    libressl)
      wget http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$USELIBRESSL.tar.gz
      tar xfz libressl-$USELIBRESSL.tar.gz
      (cd libressl-$USELIBRESSL &&
        ./configure --prefix=/opt/libressl-$USELIBRESSL &&
        make &&
        sudo make install)
      configure_flags="--with-ssl=/opt/libressl-$USELIBRESSL --without-gnutls --without-nss"
{'fraction_non_alphanumeric': 0.1308335031587528, 'fraction_numerical': 0.015488078255553291, 'mean_word_length': 2.876777251184834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '77639', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1745, 'n_words': 419}