summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2012-10-24 12:23:21 -0700
committerBryan McLellan <btm@opscode.com>2012-10-24 12:23:21 -0700
commite4419e4144ecca0742d224a5f03d94ff91608515 (patch)
tree356f09712c5bd3154058de8ab002ac797ad3a825
parent6c6f277261f4dbdcff73fec2f2d7548597255c7a (diff)
parent68f9a21a8b8e44fd560ed4805730fb2feb6df933 (diff)
downloadchef-e4419e4144ecca0742d224a5f03d94ff91608515.tar.gz
Merge branch 'CHEF-3394' into 10-stable
-rw-r--r--chef/lib/chef/knife/cookbook_site_install.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/chef/lib/chef/knife/cookbook_site_install.rb b/chef/lib/chef/knife/cookbook_site_install.rb
index b2e0d84751..584735d8ff 100644
--- a/chef/lib/chef/knife/cookbook_site_install.rb
+++ b/chef/lib/chef/knife/cookbook_site_install.rb
@@ -107,6 +107,7 @@ class Chef
end
end
+
unless config[:no_deps]
md = Chef::Cookbook::Metadata.new
md.from_file(File.join(@install_path, @cookbook_name, "metadata.rb"))
@@ -143,13 +144,21 @@ class Chef
def extract_cookbook(upstream_file, version)
ui.info("Uncompressing #{@cookbook_name} version #{version}.")
- shell_out!("tar zxvf #{Shellwords.escape upstream_file}", :cwd => @install_path)
+ shell_out!("tar zxvf #{convert_path upstream_file}", :cwd => @install_path)
end
def clear_existing_files(cookbook_path)
ui.info("Removing pre-existing version.")
FileUtils.rmtree(cookbook_path) if File.directory?(cookbook_path)
end
+
+ def convert_path(upstream_file)
+ if ENV['MSYSTEM'] == 'MINGW32'
+ return upstream_file.sub(/^([[:alpha:]]):/, '/\1')
+ else
+ return Shellwords.escape upstream_file
+ end
+ end
end
end
end