vagrant-bindfs 1.1.5 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/vagrant-bindfs/bindfs/folder.rb +4 -5
- data/lib/vagrant-bindfs/bindfs/option_definitions.json +2 -0
- data/lib/vagrant-bindfs/bindfs/option_set.rb +6 -7
- data/lib/vagrant-bindfs/bindfs/validators/config.rb +3 -3
- data/lib/vagrant-bindfs/bindfs.rb +1 -1
- data/lib/vagrant-bindfs/vagrant/actions/concerns/machine.rb +3 -5
- data/lib/vagrant-bindfs/vagrant/actions/installer.rb +2 -2
- data/lib/vagrant-bindfs/vagrant/actions/mounter.rb +4 -4
- data/lib/vagrant-bindfs/vagrant/capabilities/gentoo/bindfs.rb +1 -1
- data/lib/vagrant-bindfs/vagrant/config.rb +40 -25
- data/lib/vagrant-bindfs/vagrant/plugin.rb +5 -7
- data/lib/vagrant-bindfs/version.rb +1 -1
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 800a3b50cbd19c5884f697e0957aab4bf0daa59eda7ab32cc99ba27ad71b5c57
|
4
|
+
data.tar.gz: ae67d5c8a1cada029ef51fa381abdb31b5f7ad10aac0620b842f83cb263957de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9e690f89355198da51afe1741be3c0e8c93cbe2fb5c934b6517d5e2973919c3e54c8990789f7a1ddb900c4116ecdab32cb6a09405b2f9d042d4aa7656f7e7e0
|
7
|
+
data.tar.gz: a24dec7d238c4fc61a3689030ab4e8807ecbbf236af2bed3b1f008877998a4994c8f27ffc9e4cc17d410d362b8088c0da9803aab5d2aa6d8eb0d4f1dea562ba4
|
data/README.md
CHANGED
@@ -92,7 +92,7 @@ Remember that Vagrant use `/vagrant` on guest side to automatically share your p
|
|
92
92
|
### bindfs support
|
93
93
|
|
94
94
|
The `bind_folder` config accept any option you can pass to bindfs.
|
95
|
-
vagrant-bindfs is compatible with bindfs from version 1.9 to 1.14.
|
95
|
+
vagrant-bindfs is compatible with bindfs from version 1.9 to 1.14.7.
|
96
96
|
Check [lib/vagrant-bindfs/bindfs/option_definitions.json](https://github.com/gael-ian/vagrant-bindfs/blob/master/lib/vagrant-bindfs/bindfs/option_definitions.json) for a complete list of supported options and default values and read the [bindfs man page](http://bindfs.org/docs/bindfs.1.html) for full documentation.
|
97
97
|
|
98
98
|
Both long arguments and shorthand are supported.
|
@@ -186,7 +186,7 @@ Mount poitns will then be destroyed (with `rm -rf`) prior to mount, unless you a
|
|
186
186
|
```ruby
|
187
187
|
Vagrant.configure("2") do |config|
|
188
188
|
|
189
|
-
config.bindfs.
|
189
|
+
config.bindfs.force_empty_mountpoints = true
|
190
190
|
|
191
191
|
# This exemple assume two directories exist in your VM:
|
192
192
|
# - `a/non/empty/mount/point/and/its/content`
|
@@ -5,11 +5,10 @@ require 'digest/sha1'
|
|
5
5
|
module VagrantBindfs
|
6
6
|
module Bindfs
|
7
7
|
class Folder
|
8
|
-
attr_reader :source
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
attr_reader :hook
|
8
|
+
attr_reader :source,
|
9
|
+
:destination,
|
10
|
+
:options,
|
11
|
+
:hook
|
13
12
|
|
14
13
|
def initialize(hook, source, destination, options = {})
|
15
14
|
@hook = hook
|
@@ -7,6 +7,8 @@
|
|
7
7
|
"mirror": { "long": ["mirror"], "short": ["m"], "type": "option", "since": "0.0.1" },
|
8
8
|
"mirror-only": { "long": ["mirror-only"], "short": ["M"], "type": "option", "since": "0.0.1" },
|
9
9
|
"map": { "long": ["map"], "short": [], "type": "option", "since": "1.10" },
|
10
|
+
"map-passwd": { "long": ["map-passwd"], "short": [], "type": "option", "since": "1.14.6" },
|
11
|
+
"map-group": { "long": ["map-group"], "short": [], "type": "option", "since": "1.14.6" },
|
10
12
|
"uid-offset": { "long": ["uid-offset"], "short": [], "type": "option", "since": "1.13.2" },
|
11
13
|
"gid-offset": { "long": ["gid-offset"], "short": [], "type": "option", "since": "1.13.2" },
|
12
14
|
|
@@ -5,15 +5,14 @@ require 'forwardable'
|
|
5
5
|
module VagrantBindfs
|
6
6
|
module Bindfs
|
7
7
|
class OptionSet
|
8
|
-
attr_reader :version
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
attr_reader :unsupported_options
|
8
|
+
attr_reader :version,
|
9
|
+
:options,
|
10
|
+
:invalid_options,
|
11
|
+
:unsupported_options
|
13
12
|
|
14
13
|
include ::Enumerable
|
15
14
|
extend ::Forwardable
|
16
|
-
def_delegators :@options, :each, :[], :keys, :key
|
15
|
+
def_delegators :@options, :each, :[], :keys, :key?, :to_h
|
17
16
|
|
18
17
|
def initialize(version = nil, options = {})
|
19
18
|
@version = version
|
@@ -101,7 +100,7 @@ module VagrantBindfs
|
|
101
100
|
return true if [true, 'true', 'True', 'yes', 'Yes', 'y', 'Y', 'on', 'On', 1].include?(value)
|
102
101
|
return false if [false, 'false', 'False', 'no', 'No', 'n', 'N', 'off', 'Off', 0].include?(value)
|
103
102
|
|
104
|
-
!!value
|
103
|
+
!!value
|
105
104
|
end
|
106
105
|
|
107
106
|
class << self
|
@@ -6,8 +6,8 @@ module VagrantBindfs
|
|
6
6
|
module Bindfs
|
7
7
|
module Validators
|
8
8
|
class Config
|
9
|
-
attr_reader :folder
|
10
|
-
|
9
|
+
attr_reader :folder,
|
10
|
+
:errors
|
11
11
|
|
12
12
|
extend ::Forwardable
|
13
13
|
def_delegators :@folder, :source, :destination, :options
|
@@ -38,7 +38,7 @@ module VagrantBindfs
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def validate_options!
|
41
|
-
folder.options.invalid_options.
|
41
|
+
folder.options.invalid_options.each_key do |option_name|
|
42
42
|
@errors << I18n.t(option_name.tr('-', '_'), scope: 'vagrant-bindfs.deprecations')
|
43
43
|
end
|
44
44
|
end
|
@@ -14,11 +14,9 @@ module VagrantBindfs
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def bound_folders(hook = nil)
|
17
|
-
@bound_folders ||=
|
18
|
-
|
19
|
-
|
20
|
-
bound
|
21
|
-
end
|
17
|
+
@bound_folders ||= config.bound_folders.each_with_object({}) do |(id, folder), bound|
|
18
|
+
bound[id] = folder if hook.nil? || folder.hook == hook
|
19
|
+
bound
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
@@ -4,9 +4,9 @@ module VagrantBindfs
|
|
4
4
|
module Vagrant
|
5
5
|
module Actions
|
6
6
|
class Mounter
|
7
|
-
attr_reader :app
|
8
|
-
|
9
|
-
|
7
|
+
attr_reader :app,
|
8
|
+
:env,
|
9
|
+
:hook
|
10
10
|
|
11
11
|
include Concerns::Machine
|
12
12
|
include Concerns::Log
|
@@ -61,7 +61,7 @@ module VagrantBindfs
|
|
61
61
|
|
62
62
|
def empty_mountpoint?(folder)
|
63
63
|
return false unless config.force_empty_mountpoints
|
64
|
-
return false if folder.options.key?('o') &&
|
64
|
+
return false if folder.options.key?('o') && folder.options['o'].include?('nonempty')
|
65
65
|
|
66
66
|
true
|
67
67
|
end
|
@@ -27,7 +27,7 @@ module VagrantBindfs
|
|
27
27
|
# Ensure equery is installed
|
28
28
|
comm.sudo('emerge app-portage/gentoolkit')
|
29
29
|
comm.sudo("equery -q list -po -F '$fullversion' #{bindfs_package_name} || true") do |_, output|
|
30
|
-
output.strip.gsub(/\s+/, ' ').split
|
30
|
+
output.strip.gsub(/\s+/, ' ').split.each do |package_version|
|
31
31
|
return package_version unless package_version.match(/^#{version}/).nil?
|
32
32
|
end
|
33
33
|
end
|
@@ -3,28 +3,29 @@
|
|
3
3
|
module VagrantBindfs
|
4
4
|
module Vagrant
|
5
5
|
class Config < ::Vagrant.plugin('2', :config)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
DEFAULT_OPTIONS = {
|
7
|
+
'force-user' => 'vagrant',
|
8
|
+
'force-group' => 'vagrant',
|
9
|
+
'perms' => 'u=rwX:g=rD:o=rD'
|
10
|
+
}.freeze
|
11
|
+
|
12
|
+
attr_reader :debug,
|
13
|
+
:install_bindfs_from_source,
|
14
|
+
:default_options,
|
15
|
+
:force_empty_mountpoints
|
16
|
+
|
17
|
+
attr_accessor :bindfs_version,
|
18
|
+
:bound_folders,
|
19
|
+
:skip_validations
|
20
|
+
|
21
|
+
def initialize # rubocop:disable Lint/MissingSuper
|
18
22
|
@debug = false
|
19
23
|
|
20
24
|
@bindfs_version = UNSET_VALUE
|
21
25
|
@install_bindfs_from_source = false
|
22
26
|
|
23
27
|
@bound_folders = {}
|
24
|
-
@default_options =
|
25
|
-
'force-user' => 'vagrant',
|
26
|
-
'force-group' => 'vagrant',
|
27
|
-
'perms' => 'u=rwX:g=rD:o=rD')
|
28
|
+
@default_options = UNSET_VALUE
|
28
29
|
|
29
30
|
@skip_validations = []
|
30
31
|
@force_empty_mountpoints = false
|
@@ -62,22 +63,20 @@ module VagrantBindfs
|
|
62
63
|
|
63
64
|
def merge(other) # rubocop:disable Metrics/AbcSize
|
64
65
|
super.tap do |result|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
result.bindfs_version = result_bindfs_version unless result_bindfs_version.nil?
|
69
|
-
result.install_bindfs_from_source = (install_bindfs_from_source || other.install_bindfs_from_source)
|
70
|
-
|
71
|
-
result.default_options = default_options.merge(other.default_options)
|
66
|
+
%i[debug force_empty_mountpoints install_bindfs_from_source].each do |boolean|
|
67
|
+
result.send("#{boolean}=", (send(boolean) || other.send(boolean)))
|
68
|
+
end
|
72
69
|
result.bound_folders = bound_folders.merge(other.bound_folders)
|
73
|
-
|
74
70
|
result.skip_validations = (skip_validations + other.skip_validations).uniq
|
75
|
-
|
71
|
+
|
72
|
+
result.bindfs_version = merge_bindfs_version(other) unless merge_bindfs_version(other) == UNSET_VALUE
|
73
|
+
result.default_options = merge_default_options(other) unless merge_default_options(other) == UNSET_VALUE
|
76
74
|
end
|
77
75
|
end
|
78
76
|
|
79
77
|
def finalize!
|
80
78
|
@bindfs_version = :latest if @bindfs_version == UNSET_VALUE
|
79
|
+
self.default_options = DEFAULT_OPTIONS if default_options == UNSET_VALUE
|
81
80
|
end
|
82
81
|
|
83
82
|
def validate(_machine)
|
@@ -90,6 +89,22 @@ module VagrantBindfs
|
|
90
89
|
|
91
90
|
{ 'vagrant-bindfs' => errors.flatten }
|
92
91
|
end
|
92
|
+
|
93
|
+
protected
|
94
|
+
|
95
|
+
def merge_bindfs_version(other)
|
96
|
+
return other.bindfs_version if bindfs_version == UNSET_VALUE
|
97
|
+
return bindfs_version if other.bindfs_version == UNSET_VALUE
|
98
|
+
|
99
|
+
[bindfs_version, other.bindfs_version].reject { |v| v == UNSET_VALUE }.min
|
100
|
+
end
|
101
|
+
|
102
|
+
def merge_default_options(other)
|
103
|
+
return other.default_options if default_options == UNSET_VALUE
|
104
|
+
return default_options if other.default_options == UNSET_VALUE
|
105
|
+
|
106
|
+
default_options.merge(other.default_options)
|
107
|
+
end
|
93
108
|
end
|
94
109
|
end
|
95
110
|
end
|
@@ -25,16 +25,14 @@ module VagrantBindfs
|
|
25
25
|
|
26
26
|
class << self
|
27
27
|
def hooks
|
28
|
-
@hooks ||=
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
end
|
28
|
+
@hooks ||= {
|
29
|
+
synced_folders: synced_folders_hook,
|
30
|
+
provision: ::Vagrant::Action::Builtin::Provision
|
31
|
+
}
|
34
32
|
end
|
35
33
|
|
36
34
|
def synced_folders_hook
|
37
|
-
if ::Vagrant::Action::Builtin.const_defined?
|
35
|
+
if ::Vagrant::Action::Builtin.const_defined?(:NFS, false)
|
38
36
|
::Vagrant::Action::Builtin::NFS
|
39
37
|
else
|
40
38
|
::Vagrant::Action::Builtin::SyncedFolders
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-bindfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaël-Ian Havard
|
8
8
|
- Igor Serebryany
|
9
9
|
- Thomas Boerger
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-09-21 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: " A Vagrant plugin to automate bindfs mount in the VM. This allow you
|
16
16
|
to change owner, group and permissions on files and, for example, work around NFS
|
@@ -86,7 +86,7 @@ licenses:
|
|
86
86
|
metadata:
|
87
87
|
allowed_push_host: https://rubygems.org
|
88
88
|
issue_tracker: https://github.com/gael-ian/vagrant-bindfs/issues
|
89
|
-
post_install_message:
|
89
|
+
post_install_message:
|
90
90
|
rdoc_options: []
|
91
91
|
require_paths:
|
92
92
|
- lib
|
@@ -94,18 +94,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '2.
|
98
|
-
- - "<"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '2.7'
|
97
|
+
version: '2.4'
|
101
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
99
|
requirements:
|
103
100
|
- - ">="
|
104
101
|
- !ruby/object:Gem::Version
|
105
102
|
version: 1.3.6
|
106
103
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
104
|
+
rubygems_version: 3.1.2
|
105
|
+
signing_key:
|
109
106
|
specification_version: 4
|
110
107
|
summary: A Vagrant plugin to automate bindfs mount in the VM
|
111
108
|
test_files:
|