Fix `sed` calls for linux and add proper options for the UID/GID mapping.

This commit is contained in:
Mitchell Hashimoto 2010-07-17 09:58:30 -07:00
parent 67b23be473
commit f8909dcbfa
3 changed files with 5 additions and 2 deletions

View File

@ -42,7 +42,7 @@ module Vagrant
if $?.to_i == 0
# Use sed to just strip out the block of code which was inserted
# by Vagrant
system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -i bak /etc/exports")
system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -ibak /etc/exports")
end
end
end

View File

@ -1,3 +1,3 @@
# VAGRANT-BEGIN: <%= uuid %>
<% folders.each do |name, opts| %><%= opts[:hostpath] %> <%= ip %>(rw<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)<% end %>
<% folders.each do |name, opts| %><%= opts[:hostpath] %> <%= ip %>(rw,no_subtree_check,all_squash<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)<% end %>
# VAGRANT-END: <%= uuid %>

View File

@ -119,6 +119,7 @@ Gem::Specification.new do |s|
"templates/chef_solo_solo.erb",
"templates/network_entry.erb",
"templates/nfs/exports.erb",
"templates/nfs/exports_linux.erb",
"templates/package_Vagrantfile.erb",
"templates/ssh_config.erb",
"templates/strings.yml",
@ -186,6 +187,7 @@ Gem::Specification.new do |s|
"test/vagrant/environment_test.rb",
"test/vagrant/hosts/base_test.rb",
"test/vagrant/hosts/bsd_test.rb",
"test/vagrant/hosts/linux_test.rb",
"test/vagrant/provisioners/base_test.rb",
"test/vagrant/provisioners/chef_server_test.rb",
"test/vagrant/provisioners/chef_solo_test.rb",
@ -256,6 +258,7 @@ Gem::Specification.new do |s|
"test/vagrant/systems/linux_test.rb",
"test/vagrant/config_test.rb",
"test/vagrant/hosts/base_test.rb",
"test/vagrant/hosts/linux_test.rb",
"test/vagrant/hosts/bsd_test.rb",
"test/vagrant/active_list_test.rb",
"test/vagrant/commands/base_test.rb",