diff --git a/lib/vagrant/action/general/package.rb b/lib/vagrant/action/general/package.rb index aa78313cf..e9ba6d95a 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -1,5 +1,6 @@ require 'fileutils' -require 'archive/tar/minitar' + +require 'vagrant/util/subprocess' module Vagrant module Action @@ -73,21 +74,17 @@ module Vagrant # Compress the exported file into a package def compress @env[:ui].info I18n.t("vagrant.actions.general.package.compressing", :tar_path => tar_path) - File.open(tar_path, Platform.tar_file_options) do |tar| - Archive::Tar::Minitar::Output.open(tar) do |output| - begin - current_dir = FileUtils.pwd - copy_include_files + # Copy over the included files + copy_include_files - FileUtils.cd(@env["package.directory"]) - Dir.glob(File.join(".", "**", "*")).each do |entry| - Archive::Tar::Minitar.pack_file(entry, output) - end - ensure - FileUtils.cd(current_dir) - end - end + # Switch into that directory and package everything up + Dir.chdir(@env["package.directory"]) do + # Find all the files in our current directory and tar it up! + files = Dir.glob(File.join(".", "**", "*")) + + # Package! + Util::Subprocess.execute("bsdtar", "-czf", tar_path.to_s, *files) end end