vagrant-bindfs 0.4.11 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16065d7f1c9090dfcae7c64cfe1a0ff2503ee6ab
4
- data.tar.gz: f358e402c150b416cb23a6f7875dcbc19b337c0e
3
+ metadata.gz: e4f4c521a2a2619356b7466fffa5b6c577799c62
4
+ data.tar.gz: bacede149f11117d49abc53fb15a220f18826907
5
5
  SHA512:
6
- metadata.gz: 3b4c83228d585fe252ccee7f2160e0278bfb8f5f9fecf5cdb574b3e1137d63af70b36351c97d622a00df5a7034fdaffc62daa7bf9ec62e0315a576557faa9545
7
- data.tar.gz: 785f266c86f3de5c7593d9c629244b16a1b857aaad94aa9a1ef7ebec27d9eaac83c98a5d18c46a3709d6054993d3d2d1d160fdf047916f06373d5e8f2c2152bb
6
+ metadata.gz: a4102bf7c0c8911fe0b034f8d46b0d1c338ee3abe882e0d39d23480cb51a5dee1457e2005e9fa4ea18985574953c0e2463bde4f12c1a6303efa200e07aa13c4a
7
+ data.tar.gz: 75682be67816e612f517bb224b8293cc22932b09a320168808fc566ab2143cbdcd02a09344ffde10f0b4bfb943fcfe40a6e3c1fd71ae010a26af945c95492ddc
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # vagrant-bindfs
2
2
 
3
- A Vagrant plugin to automate [bindfs](http://bindfs.org/) mount in the VM. This allow you to change
4
- owner, group and permissions on files and, for example, work around NFS share permissions issues.
3
+ A Vagrant plugin to automate [bindfs](http://bindfs.org/) mount in the VM. This allow you to change owner, group and permissions on files and, for example, work around NFS share permissions issues.
5
4
 
6
5
 
7
6
  ## Some Background: Why `vagrant-bindfs`
@@ -13,7 +12,7 @@ People often recommend switching to [vagrant's VMWare-fusion provider](http://ww
13
12
  This reportedly has better performance, but shares with symlinks [won't work](http://communities.vmware.com/thread/428199?start=0&tstart=0).
14
13
  You also have to buy both the plugin and VMware Fusion.
15
14
 
16
- The final recommendation, at least on Linux/OSX hosts, is to [use nfs](http://docs.vagrantup.com/v2/synced-folders/nfs.html).
15
+ The final recommendation, at least on Linux/OSX hosts, is to [use NFS](http://docs.vagrantup.com/v2/synced-folders/nfs.html).
17
16
  However, an NFS mount has the same numeric permissions in the guest as in the host.
18
17
  If you're on OSX, for instance, a folder owned by the default OSX user will appear to be [owned by `501:20`](https://groups.google.com/forum/?fromgroups#!topic/vagrant-up/qXXJ-AQuKQM) in the guest.
19
18
 
@@ -29,7 +28,7 @@ _Note that `map_uid` and `map_gid` NFS options can be used to set the identity u
29
28
 
30
29
  ## Installation
31
30
 
32
- Vagrant-bindfs is distributed as a Ruby gem.
31
+ vagrant-bindfs is distributed as a Ruby gem.
33
32
  You can install it as any other Vagrant plugin with `vagrant plugin install vagrant-bindfs`.
34
33
 
35
34
 
@@ -78,21 +77,18 @@ Vagrant.configure("2") do |config|
78
77
  # Use vagrant-bindfs to re-mount folder
79
78
  config.bindfs.bind_folder "/vagrant-nfs", "guest/mount/point"
80
79
 
81
-
82
- ## Share the default `vagrant` folder via NFS with your own options
83
- config.vm.synced_folder ".", "/vagrant", type: :nfs
84
- config.bindfs.bind_folder "/vagrant", "/vagrant"
85
-
86
80
  # Bind a folder after provisioning
87
81
  config.bindfs.bind_folder "/vagrant-after-provision", "another/guest/mount/point", after: :provision
88
82
 
89
83
  end
90
84
  ```
91
85
 
86
+ Remember that Vagrant use `/vagrant` on guest side as a shared directory dedicated to provisioning and configuration. Binding a folder to `/vagrant` or one of its subfolders will fail.
87
+
92
88
  ### bindfs support
93
89
 
94
90
  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.13.1.
91
+ vagrant-bindfs is compatible with bindfs from version 1.9 to 1.13.4.
96
92
  Check [lib/vagrant-bindfs/command.rb](https://github.com/gael-ian/vagrant-bindfs/blob/master/lib/vagrant-bindfs/command.rb#L66) 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
93
 
98
94
  Both long arguments and shorthand are supported.
@@ -14,26 +14,36 @@ module VagrantPlugins
14
14
  else
15
15
  comm.sudo("yum -y install fuse fuse-devel gcc wget tar make")
16
16
  comm.sudo <<-SHELL
17
- for u in "#{SOURCE_URLS.join('" "')}"; do
17
+ for u in "#{source_urls(machine).join('" "')}"; do
18
18
  if wget -q --spider $u; then
19
19
  url=$u;
20
20
  break;
21
21
  fi;
22
22
  done;
23
- [ -n "$url" ] && \
24
- wget $url -O bindfs.tar.gz && \
25
- tar --overwrite -zxvf bindfs.tar.gz && \
26
- [ -d ./bindfs-#{SOURCE_VERSION} ] && \
27
- cd bindfs-#{SOURCE_VERSION} && \
28
- ./configure && \
29
- make && \
30
- make install && \
23
+ [ -n "$url" ] && \
24
+ wget $url -O bindfs.tar.gz && \
25
+ tar --overwrite -zxvf bindfs.tar.gz && \
26
+ [ -d ./bindfs-#{source_version(machine)} ] && \
27
+ cd bindfs-#{source_version(machine)} && \
28
+ ./configure && \
29
+ make && \
30
+ make install && \
31
31
  ln -s /usr/local/bin/bindfs /usr/bin
32
32
  SHELL
33
33
  end
34
34
  end
35
35
  end
36
36
 
37
+ protected
38
+
39
+ def source_urls(machine)
40
+ SOURCE_URLS.map{ |url| url.gsub('%{source_version}', source_version(machine)) }
41
+ end
42
+
43
+ def source_version(machine)
44
+ machine.config.bindfs.source_version
45
+ end
46
+
37
47
  end
38
48
  end
39
49
  end
@@ -1,17 +1,21 @@
1
- require 'vagrant'
2
- require 'vagrant/errors'
3
- require 'vagrant/util/template_renderer'
1
+ require "vagrant"
4
2
 
5
3
  module VagrantPlugins
6
4
  module Bindfs
7
5
  class Config < Vagrant.plugin("2", :config)
8
- attr_accessor :default_options, :debug, :bind_folders
6
+
7
+ attr_accessor :debug
8
+ attr_accessor :source_version
9
+
10
+ attr_accessor :default_options
11
+ attr_accessor :bind_folders
9
12
 
10
13
  def initialize
11
- @default_options = UNSET_VALUE
12
- @debug = UNSET_VALUE
13
- @bind_folders = {}
14
- @logger = Log4r::Logger.new('vagrantplugins::bindfs::config')
14
+ @debug = UNSET_VALUE
15
+ @source_version = UNSET_VALUE
16
+
17
+ @default_options = UNSET_VALUE
18
+ @bind_folders = {}
15
19
  end
16
20
 
17
21
  def default_options(new_values = {})
@@ -44,8 +48,17 @@ module VagrantPlugins
44
48
  end
45
49
 
46
50
  def finalize!
47
- @default_options = {} if @default_options == UNSET_VALUE
48
- @debug = false if @debug == UNSET_VALUE
51
+ if @debug == UNSET_VALUE
52
+ @debug = false
53
+ end
54
+
55
+ if @source_version == UNSET_VALUE
56
+ @source_version = VagrantPlugins::Bindfs::SOURCE_VERSION
57
+ end
58
+
59
+ if @default_options == UNSET_VALUE
60
+ @default_options = {}
61
+ end
49
62
  end
50
63
 
51
64
  def validate!(machine)
@@ -82,6 +95,13 @@ module VagrantPlugins
82
95
  path: options[:source_path]
83
96
  )
84
97
  end
98
+
99
+ unless Pathname.new(options[:dest_path]).to_path.match(/^\/vagrant/).nil?
100
+ errors << I18n.t(
101
+ "vagrant.config.bindfs.errors.destination_path_reserved",
102
+ path: options[:dest_path]
103
+ )
104
+ end
85
105
  end
86
106
 
87
107
  if errors.any?
@@ -1,12 +1,12 @@
1
1
  module VagrantPlugins
2
2
  module Bindfs
3
3
 
4
- VERSION = "0.4.11"
4
+ VERSION = "0.4.12"
5
5
 
6
6
  SOURCE_VERSION = "1.13.4"
7
7
  SOURCE_URLS = [
8
- "http://bindfs.org/downloads/bindfs-#{SOURCE_VERSION}.tar.gz",
9
- "http://bindfs.dnsalias.net/downloads/bindfs-#{SOURCE_VERSION}.tar.gz"
8
+ "http://bindfs.org/downloads/bindfs-%{source_version}.tar.gz",
9
+ "http://bindfs.dnsalias.net/downloads/bindfs-%{source_version}.tar.gz"
10
10
  ]
11
11
 
12
12
  end
data/locales/en.yml CHANGED
@@ -13,8 +13,9 @@ en:
13
13
  errors:
14
14
  invalid_hook: "Invalid hook specified. Must use one of %{hooks}"
15
15
  no_path_supplied: "You must pass a destination and a source path as arguments"
16
- destination_path_relative: "Destination path is relative for bind whatever"
17
- source_path_relative: "Source path is relative for bind whatever"
16
+ destination_path_relative: "Destination path %{path} is relative for bind whatever"
17
+ destination_path_reserved: "Destination path %{path} is part of a reserved subtree for Vagrant use"
18
+ source_path_relative: "Source path %{path} is relative for bind whatever"
18
19
  source_path_not_exist: "Cannot bind source path %{path} because it doesn't exist"
19
20
  user_not_exist: "Cannot bind to user '%{user}' because it doesn't exist"
20
21
  group_not_exist: "Cannot bind to group '%{group}' because it doesn't exist"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-bindfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-28 00:00:00.000000000 Z
13
+ date: 2016-11-18 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
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '2.2'
66
+ version: 2.0.0
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="