From 3b5d6c65fdfe4f1a9d54d4ab3a58c2b965795b4f Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Mon, 3 Feb 2014 23:17:54 -0300 Subject: [PATCH] guests/openbsd: Ensure that `PKG_PATH` is set when installing rsync Depending on the shell, `PKG_PATH` is not necessarily set when Vagrant runs `pkg_add`. Ref: GH-2917 --- plugins/guests/netbsd/cap/rsync.rb | 4 ++-- plugins/guests/openbsd/cap/rsync.rb | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/guests/netbsd/cap/rsync.rb b/plugins/guests/netbsd/cap/rsync.rb index 1c7d4e72e..7f8550017 100644 --- a/plugins/guests/netbsd/cap/rsync.rb +++ b/plugins/guests/netbsd/cap/rsync.rb @@ -8,8 +8,8 @@ module VagrantPlugins def self.rsync_install(machine) machine.communicate.sudo( - 'export PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/' \ - '`uname -m`/`uname -r | cut -d. -f1-2`/All"; ' \ + 'PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/' \ + '`uname -m`/`uname -r | cut -d. -f1-2`/All" ' \ 'pkg_add rsync') end diff --git a/plugins/guests/openbsd/cap/rsync.rb b/plugins/guests/openbsd/cap/rsync.rb index 269f6e101..0e591ad62 100644 --- a/plugins/guests/openbsd/cap/rsync.rb +++ b/plugins/guests/openbsd/cap/rsync.rb @@ -3,9 +3,10 @@ module VagrantPlugins module Cap class RSync def self.rsync_install(machine) - machine.communicate.tap do |comm| - comm.sudo("pkg_add -I rsync--") - end + machine.communicate.sudo( + 'PKG_PATH="http://ftp.openbsd.org/pub/OpenBSD/' \ + '`uname -r`/packages/`arch -s`/" ' \ + 'pkg_add -I rsync--') end def self.rsync_installed(machine)