Module: VagrantBindfs::Vagrant::Capabilities::Suse::Bindfs

Defined in:
lib/vagrant-bindfs/vagrant/capabilities/suse/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/suse/bindfs.rb', line 14

def bindfs_bindfs_install(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.sudo('zypper -n install bindfs')
end

.bindfs_bindfs_install_compilation_requirements(machine) ⇒ Object



38
39
40
41
42
43
# File 'lib/vagrant-bindfs/vagrant/capabilities/suse/bindfs.rb', line 38

def bindfs_bindfs_install_compilation_requirements(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.tap do |comm|
    comm.sudo('zypper -n install make automake gcc gcc-c++ kernel-devel wget tar fuse3-devel')
  end
end

.bindfs_bindfs_install_version(machine, version) ⇒ Object

rubocop:enable Layout/LineLength



32
33
34
35
36
# File 'lib/vagrant-bindfs/vagrant/capabilities/suse/bindfs.rb', line 32

def bindfs_bindfs_install_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  package_name = machine.guest.capability(:bindfs_bindfs_search_version, version)
  machine.communicate.sudo("zypper -n in -f #{package_name.shellescape}")
end

.bindfs_bindfs_search(machine) ⇒ Object



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

def bindfs_bindfs_search(machine)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.test('zypper se -s bindfs')
end

.bindfs_bindfs_search_version(machine, version) ⇒ Object

rubocop:disable Layout/LineLength



20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-bindfs/vagrant/capabilities/suse/bindfs.rb', line 20

def bindfs_bindfs_search_version(machine, version)
  machine.guest.capability(:bindfs_package_manager_update)
  machine.communicate.tap do |comm|
    comm.sudo("zypper se -s bindfs | sed -n '/bindfs/,${p}' | cut -d'|' -f2,4 --output-delimiter='-'") do |_, output|
      package_name = output.strip
      return package_name if !package_name.empty? && !package_name.match(/^bindfs-#{version}/).nil?
    end
  end
  false
end