synced_folders/rsync: mkdir before rsync

This commit is contained in:
Mitchell Hashimoto 2014-05-06 13:41:37 -07:00
parent d4087db7c5
commit 4ef237a642
9 changed files with 49 additions and 0 deletions

View File

@ -10,6 +10,7 @@ BUG FIXES:
Vagrantfile.
- commands/package: `--base` works without crashing for VirtualBox.
- guests/redhat: Fix networking issues with CentOS. [GH-3649]
- synced\_folders/rsync: Create the directory before syncing.
## 1.6.0 (May 6, 2014)

View File

@ -10,6 +10,12 @@ module VagrantPlugins
"sudo rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +

View File

@ -16,6 +16,12 @@ module VagrantPlugins
"sudo rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +

View File

@ -10,6 +10,12 @@ module VagrantPlugins
"sudo rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +

View File

@ -17,6 +17,12 @@ module VagrantPlugins
"sudo rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +

View File

@ -17,6 +17,12 @@ module VagrantPlugins
"sudo rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +

View File

@ -10,6 +10,12 @@ module VagrantPlugins
"#{machine.config.smartos.suexec_cmd} rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
machine.communicate.sudo("find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +
"xargs -0 -r chown -v #{opts[:owner]}:#{opts[:group]}")

View File

@ -10,6 +10,12 @@ module VagrantPlugins
"#{machine.config.solaris.suexec_cmd} rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
su_cmd = machine.config.solaris.su_cmd
machine.communicate.execute(

View File

@ -10,6 +10,12 @@ module VagrantPlugins
"#{machine.config.solaris11.suexec_cmd} rsync"
end
def self.rsync_pre(machine, opts)
machine.communicate.tap do |comm|
comm.sudo("mkdir -p '#{opts[:guestpath]}'")
end
end
def self.rsync_post(machine, opts)
su_cmd = machine.config.solaris11.su_cmd
machine.communicate.execute(