From eda1ac5667fe2fe20ef9dd06a8a6bf7189ba43c1 Mon Sep 17 00:00:00 2001 From: Calvin Hendryx-Parker Date: Tue, 10 Jun 2014 15:07:50 -0400 Subject: [PATCH] Updated the rsync freebsd plugin install process for FreeBSD 10 --- plugins/guests/freebsd/cap/rsync.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/guests/freebsd/cap/rsync.rb b/plugins/guests/freebsd/cap/rsync.rb index f1f6985e4..f9174b201 100644 --- a/plugins/guests/freebsd/cap/rsync.rb +++ b/plugins/guests/freebsd/cap/rsync.rb @@ -3,8 +3,17 @@ module VagrantPlugins module Cap class RSync def self.rsync_install(machine) + version = nil + machine.communicate.execute("uname -r") do |type, result| + version = result.split('.')[0].to_i if type == :stdout + end + if version >= 10 + pkg_cmd = "pkg install -y" + else + pkg_cmd = "pkg_add -r" + end machine.communicate.tap do |comm| - comm.sudo("pkg_add -r rsync") + comm.sudo(pkg_cmd+" rsync") end end