<commit_before>#!/bin/bash
#
# Install guest additions and apply security updates.
#
# Usage:
#   install-guest-additions.sh input-box output-box
#

set -ex

box="$1"
outbox="$2"
vmware_box="$3"
vmware_outbox="$4"

name="$(basename "${outbox}" .box)-$$"

# Ensure vbguest plugin installed.
vagrant plugin list | grep vagrant-vbguest || vagrant plugin install vagrant-vbguest

# Ensure vmware-desktop plugin installed.
vagrant plugin list | grep vagrant-vmware-desktop || vagrant plugin install vagrant-vmware-desktop

# Create temporary vagrant directory.
export VAGRANT_CWD="$(mktemp -d -t "${name}")"

# Register base box.
vagrant box add --name "${name}" "${box}"
vagrant box add --name "${name}" "${vmware_box}"

# Install security updates.
# Install compiler and kernel headers required for building guest additions.
cat >"${VAGRANT_CWD}/Vagrantfile" <<EOF
Vagrant.configure(2) do |config|
  config.vm.box = "${name}"
  config.ssh.insert_key = false

  # Do not attempt to install guest additions.
  config.vbguest.auto_update = false
  # Do not attempt to sync folder, dependent on guest additions.
  config.vm.synced_folder ".", "/vagrant", disabled: true

  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end
  config.vm.provider "vmware_desktop" do |v|
    v.vmx["memsize"] = 1024
  end

  config.vm.provision :shell,
    inline: "sudo yum -y update --security && sudo yum -y install gcc kernel-devel-\$(uname -r)"
end
EOF
vagrant up --provider=vmware_desktop<commit_msg>conditionally install open-vm-tools for vmware provider<commit_after>#!/bin/bash
#
# Install guest additions and apply security updates.
#
# Usage:
#   install-guest-additions.sh input-box output-box
#

set -ex

box="$1"
outbox="$2"
vmware_box="$3"
vmware_outbox="$4"

name="$(basename "${outbox}" .box)-$$"

# Ensure vbguest plugin installed.
vagrant plugin list | grep vagrant-vbguest || vagrant plugin install vagrant-vbguest

# Ensure vmware-desktop plugin installed.
vagrant plugin list | grep vagrant-vmware-desktop || vagrant plugin install vagrant-vmware-desktop

# Create temporary vagrant directory.
export VAGRANT_CWD="$(mktemp -d -t "${name}")"

# Register base box.
vagrant box add --name "${name}" "${box}"
vagrant box add --name "${name}" "${vmware_box}"

# Install security updates.
# Install compiler and kernel headers required for building guest additions.
cat >"${VAGRANT_CWD}/Vagrantfile" <<EOF
Vagrant.configure(2) do |config|
  config.vm.box = "${name}"
  config.ssh.insert_key = false

  # Do not attempt to install guest additions.
  config.vbguest.auto_update = false
  # Do not attempt to sync folder, dependent on guest additions.
  config.vm.synced_folder ".", "/vagrant", disabled: true

  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end
  config.vm.provider "vmware_desktop" do |v|
    v.vmx["memsize"] = 1024
  end

  config.vm.provision :shell,
    inline: "sudo yum -y update --security && sudo yum -y install gcc kernel-devel-\$(uname -r)"

  config.vm.provider "vmware_desktop" do |vmware, override|
    # install guest additions and make sure they stay up to date with kernel updates
    override.vm.provision :shell,
      inline: "sudo yum --enablerepo=epel install -y open-vm-tools && echo \"answer AUTO_KMODS_ENABLED yes\" | sudo tee -a /etc/vmware-tools/locations"
  end
end
EOF
vagrant up --provider=vmware_desktop
{'fraction_non_alphanumeric': 0.12975059382422802, 'fraction_numerical': 0.007719714964370546, 'mean_word_length': 4.175115207373272, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5430813', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1103, 'n_words': 343}