diff --git a/CHANGELOG.md b/CHANGELOG.md index 084b62797..70647cc8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ BUG FIXES: - Cygwin will always output color by default. Specify `--no-color` to override this. - Assume Cygwin has a TTY for asking for input. [GH-1430] + - Expand Cygwin paths to Windows paths for calls to VBoxManage. ## 1.1.6 (April 3, 2013) diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 2f2e1b266..aaa7a92da 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -1,5 +1,4 @@ require 'rbconfig' -require 'tempfile' require "vagrant/util/subprocess" @@ -8,14 +7,6 @@ module Vagrant # This class just contains some platform checking code. class Platform class << self - def tiger? - platform.include?("darwin8") - end - - def leopard? - platform.include?("darwin9") - end - def cygwin? return true if ENV["VAGRANT_DETECTED_OS"] && ENV["VAGRANT_DETECTED_OS"].downcase.include?("cygwin") @@ -37,32 +28,14 @@ module Vagrant false end - # Returns boolean noting whether this is a 64-bit CPU. This - # is not 100% accurate and there could easily be false negatives. + # This takes any path and converts it to a full-length Windows + # path on Windows machines in Cygwin. # - # @return [Boolean] - def bit64? - ["x86_64", "amd64"].include?(RbConfig::CONFIG["host_cpu"]) - end - - # Returns boolean noting whether this is a 32-bit CPU. This - # can easily throw false positives since it relies on {#bit64?}. - # - # @return [Boolean] - def bit32? - !bit64? - end - - # This takes as input a path as a string and converts it into - # a platform-friendly version of the path. This is most important - # when using the path in shell environments with Cygwin. - # - # @param [String] path # @return [String] - def platform_path(path) + def cygwin_windows_path(path) return path if !cygwin? - process = Subprocess.execute("cygpath", "-u", path.to_s) + process = Subprocess.execute("cygpath", "-w", "-l", "-a", path.to_s) process.stdout.chomp end @@ -76,11 +49,6 @@ module Vagrant true end - def tar_file_options - # create, write only, fail if the file exists, binary if windows - File::WRONLY | File::EXCL | File::CREAT | (windows? ? File::BINARY : 0) - end - def platform RbConfig::CONFIG["host_os"].downcase end diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index 179a4bd38..8ec8ed194 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -45,7 +45,7 @@ module VagrantPlugins # and break out vboxmanage = "#{path}VBoxManage.exe" if File.file?(vboxmanage) - @vboxmanage_path = Vagrant::Util::Platform.platform_path(vboxmanage) + @vboxmanage_path = Vagrant::Util::Platform.cygwin_windows_path(vboxmanage) break end end diff --git a/plugins/providers/virtualbox/driver/version_4_0.rb b/plugins/providers/virtualbox/driver/version_4_0.rb index bdbfa3ae0..828d0e1b4 100644 --- a/plugins/providers/virtualbox/driver/version_4_0.rb +++ b/plugins/providers/virtualbox/driver/version_4_0.rb @@ -159,7 +159,7 @@ module VagrantPlugins end def import(ovf) - ovf = Vagrant::Util::Platform.platform_path(ovf) + ovf = Vagrant::Util::Platform.cygwin_windows_path(ovf) output = "" total = "" diff --git a/plugins/providers/virtualbox/driver/version_4_1.rb b/plugins/providers/virtualbox/driver/version_4_1.rb index 923240466..c6cb3a6f2 100644 --- a/plugins/providers/virtualbox/driver/version_4_1.rb +++ b/plugins/providers/virtualbox/driver/version_4_1.rb @@ -159,7 +159,7 @@ module VagrantPlugins end def import(ovf) - ovf = Vagrant::Util::Platform.platform_path(ovf) + ovf = Vagrant::Util::Platform.cygwin_windows_path(ovf) output = "" total = "" diff --git a/plugins/providers/virtualbox/driver/version_4_2.rb b/plugins/providers/virtualbox/driver/version_4_2.rb index 75d1ab56d..a145a6e69 100644 --- a/plugins/providers/virtualbox/driver/version_4_2.rb +++ b/plugins/providers/virtualbox/driver/version_4_2.rb @@ -157,7 +157,7 @@ module VagrantPlugins end def import(ovf) - ovf = Vagrant::Util::Platform.platform_path(ovf) + ovf = Vagrant::Util::Platform.cygwin_windows_path(ovf) output = "" total = ""