<commit_before>#!/bin/bash

# Automated provisioning script run as the `root` user by `vagrant up`
# -- see `./Vagrantfile`.

set -e

install_packages() {
  apt-get install -y \
    lubuntu-desktop \
    virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 \
    gstreamer0.10-tools gstreamer0.10-plugins-base \
    gstreamer0.10-plugins-good gstreamer0.10-plugins-bad \
    python-gst0.10 python-opencv python-numpy \
    curl expect openssh-client \
    lsof moreutils python-flask python-jinja2 \
    python-docutils python-nose pep8 pylint \
    gstreamer0.10-ffmpeg git v4l-utils
}
apt-get update
install_packages || {
  /usr/share/debconf/fix_db.pl  # https://bugs.launchpad.net/ubuntu/+bug/873551
  install_packages
}
apt-get install -y linux-generic-lts-quantal
# Conflicts with virtualbox-guest-x11:
# https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1160401
#apt-get install -y xserver-xorg-lts-quantal

usermod -a -G video vagrant

sudo su - vagrant /vagrant/setup-vagrant-user.sh<commit_msg>extra/vm/setup.sh: Document why each package is needed<commit_after>#!/bin/bash

# Automated provisioning script run as the `root` user by `vagrant up`
# -- see `./Vagrantfile`.

set -e

install_packages() {
  local packages
  # X11 environment so that you can use `ximagesink`
  packages=lubuntu-desktop
  # VirtualBox guest additions for shared folders, USB, window resizing, etc.
  packages+=" virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11"
  # Core stbt dependencies
  packages+=" gstreamer0.10-tools gstreamer0.10-plugins-base"
  packages+=" gstreamer0.10-plugins-good gstreamer0.10-plugins-bad"
  packages+=" python-gst0.10 python-opencv python-numpy"
  # For `stbt power`
  packages+=" curl expect openssh-client"
  # For `extra/runner`
  packages+=" lsof moreutils python-flask python-jinja2"
  # For building stbt and running the self-tests
  packages+=" git pep8 pylint python-docutils python-nose"
  # For the Hauppauge HDPVR
  packages+=" gstreamer0.10-ffmpeg v4l-utils"

  apt-get install -y $packages
}

apt-get update
install_packages || {
  /usr/share/debconf/fix_db.pl  # https://bugs.launchpad.net/ubuntu/+bug/873551
  install_packages
}

# Kernel >= 3.3 for the RedRat3 USB infrared emitter
# Note that xserver-xorg-lts-quantal conflicts with virtualbox-guest-x11:
# https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1160401
apt-get install -y linux-generic-lts-quantal

usermod -a -G video vagrant

sudo su - vagrant /vagrant/setup-vagrant-user.sh
{'fraction_non_alphanumeric': 0.11626984126984127, 'fraction_numerical': 0.03214285714285714, 'mean_word_length': 3.838771593090211, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, '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': '2529583', 'n_tokens_mistral': 984, 'n_tokens_neox': 895, 'n_words': 204}