`vagrant package` uses bsdtar
This commit is contained in:
parent
35aef1aa0b
commit
d4cf03d6c5
|
@ -1,5 +1,6 @@
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'archive/tar/minitar'
|
|
||||||
|
require 'vagrant/util/subprocess'
|
||||||
|
|
||||||
module Vagrant
|
module Vagrant
|
||||||
module Action
|
module Action
|
||||||
|
@ -73,21 +74,17 @@ module Vagrant
|
||||||
# Compress the exported file into a package
|
# Compress the exported file into a package
|
||||||
def compress
|
def compress
|
||||||
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing", :tar_path => tar_path)
|
@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 over the included files
|
||||||
copy_include_files
|
copy_include_files
|
||||||
|
|
||||||
FileUtils.cd(@env["package.directory"])
|
# Switch into that directory and package everything up
|
||||||
Dir.glob(File.join(".", "**", "*")).each do |entry|
|
Dir.chdir(@env["package.directory"]) do
|
||||||
Archive::Tar::Minitar.pack_file(entry, output)
|
# Find all the files in our current directory and tar it up!
|
||||||
end
|
files = Dir.glob(File.join(".", "**", "*"))
|
||||||
ensure
|
|
||||||
FileUtils.cd(current_dir)
|
# Package!
|
||||||
end
|
Util::Subprocess.execute("bsdtar", "-czf", tar_path.to_s, *files)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue