Module: VagrantBindfs::Vagrant::Capabilities::Debian::Bindfs

Defined in:
lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.bindfs_bindfs_install(machine) ⇒ Object



14
15
16
17
# File 'lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb', line 14

def bindfs_bindfs_install(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.sudo('apt-get install -y bindfs')
end

.bindfs_bindfs_install_compilation_requirements(machine) ⇒ Object



42
43
44
45
# File 'lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb', line 42

def bindfs_bindfs_install_compilation_requirements(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.sudo('apt-get install -y build-essential pkg-config wget tar libfuse3-dev')
end

.bindfs_bindfs_install_version(machine, version) ⇒ Object

rubocop:enable Layout/LineLength



36
37
38
39
40
# File 'lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb', line 36

def bindfs_bindfs_install_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  package_version = machine.guest.capability(:bindfs_bindfs_search_version, version)
  machine.communicate.sudo("apt-get install -y bindfs=#{package_version.shellescape}")
end

.bindfs_bindfs_search(machine) ⇒ Object



9
10
11
12
# File 'lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb', line 9

def bindfs_bindfs_search(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.test('[[ $(sudo apt-cache search bindfs | egrep "^bindfs - " | wc -l) != 0 ]]')
end

.bindfs_bindfs_search_version(machine, version) ⇒ Object

rubocop:disable Layout/LineLength



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb', line 20

def bindfs_bindfs_search_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.tap do |comm|
    # Ensure aptitude is installed as Ubuntu removed it
    comm.sudo('apt-get install aptitude')
    comm.sudo("aptitude versions bindfs | sed -n '/p/,${p}' | sed 's/\s+/ /g' | cut -d' ' -f2") do |_, output|
      package_version = output.strip
      next false if package_version.empty? || package_version.match(/^#{version}/).nil?

      "bindfs-#{package_version}"
    end
  end
  false
end