Replace tarruby with archive-tar-minitar.

Tarruby seems to not compile on 64-bit, and even its author says to use
another library. Minitar seems to be more active than libarchive so I
used that.

Tests not fixed yet.
This commit is contained in:
Ilkka Laukkanen 2010-03-09 18:25:16 +02:00 committed by Mitchell Hashimoto
parent 68d709eab9
commit de18f1e4a6
6 changed files with 12 additions and 15 deletions

View File

@ -6,7 +6,7 @@ gem "net-ssh", ">= 2.0.19"
gem "net-scp", ">= 1.0.2"
gem "git-style-binaries", ">= 0.1.10"
gem "json", ">= 1.2.0"
gem "tarruby", ">= 0.1.5"
gem "archive-tar-minitar", ">= 0.5.2"
# Gems required for testing only. To install run
# gem bundle test

View File

@ -15,7 +15,7 @@ begin
gemspec.add_dependency('net-scp', '>= 1.0.2')
gemspec.add_dependency('json', '>= 1.2.0')
gemspec.add_dependency('git-style-binaries', '>= 0.1.10')
gemspec.add_dependency('tarruby', '>= 0.1.5')
gemspec.add_dependency('archive-tar-minitar', '>= 0.5.2')
end
Jeweler::GemcutterTasks.new
rescue LoadError
@ -38,4 +38,4 @@ begin
rescue LoadError
puts "Yard not available. Install it with: gem install yard"
puts "if you wish to be able to generate developer documentation."
end
end

View File

@ -3,7 +3,7 @@ $:.unshift(libdir)
PROJECT_ROOT = File.join(libdir, '..') unless defined?(PROJECT_ROOT)
# The libs which must be loaded prior to the rest
%w{tempfile open-uri json pathname logger uri net/http virtualbox net/ssh tarruby
%w{tempfile open-uri json pathname logger uri net/http virtualbox net/ssh archive/tar/minitar
net/scp fileutils vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner}.each do |f|
require f
end

View File

@ -4,7 +4,6 @@ module Vagrant
# This action unpackages a downloaded box file into its final
# box destination within the vagrant home folder.
class Unpackage < Base
TAR_OPTIONS = [File::RDONLY, 0644, Tar::GNU]
def execute!
@runner.invoke_around_callback(:unpackage) do
@ -38,12 +37,10 @@ msg
def decompress
Dir.chdir(box_dir) do
logger.info "Extracting box to #{box_dir}..."
Tar.open(@runner.temp_path, *TAR_OPTIONS) do |tar|
tar.extract_all
end
Archive::Tar::Minitar.unpack(@runner.temp_path, box_dir)
end
end
end
end
end
end
end

View File

@ -38,18 +38,18 @@ module Vagrant
def compress
logger.info "Packaging VM into #{tar_path} ..."
Tar.open(tar_path, File::CREAT | File::WRONLY, 0644, Tar::GNU) do |tar|
open(tar_path, File::CREAT | File::WRONLY, 0644) do |tar|
begin
current_dir = FileUtils.pwd
@include_files.each do |f|
logger.info "Packaging additional file: #{f}"
tar.append_file(f)
Archive::Tar::Minitar.pack(f, tar)
end
FileUtils.cd(temp_path)
# Append tree will append the entire directory tree unless a relative folder reference is used
tar.append_tree(".")
Archive::Tar::Minitar.pack(".", tar)
ensure
FileUtils.cd(current_dir)
end

View File

@ -161,14 +161,14 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<net-scp>, [">= 1.0.2"])
s.add_runtime_dependency(%q<json>, [">= 1.2.0"])
s.add_runtime_dependency(%q<git-style-binaries>, [">= 0.1.10"])
s.add_runtime_dependency(%q<tarruby>, [">= 0.1.5"])
s.add_runtime_dependency(%q<archive-tar-minitar>, [">= 0.1.5"])
else
s.add_dependency(%q<virtualbox>, [">= 0.5.0"])
s.add_dependency(%q<net-ssh>, [">= 2.0.19"])
s.add_dependency(%q<net-scp>, [">= 1.0.2"])
s.add_dependency(%q<json>, [">= 1.2.0"])
s.add_dependency(%q<git-style-binaries>, [">= 0.1.10"])
s.add_dependency(%q<tarruby>, [">= 0.1.5"])
s.add_dependency(%q<archive-tar-minitar>, [">= 0.5.2"])
end
else
s.add_dependency(%q<virtualbox>, [">= 0.5.0"])
@ -176,7 +176,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<net-scp>, [">= 1.0.2"])
s.add_dependency(%q<json>, [">= 1.2.0"])
s.add_dependency(%q<git-style-binaries>, [">= 0.1.10"])
s.add_dependency(%q<tarruby>, [">= 0.1.5"])
s.add_dependency(%q<archive-tar-minitar>, [">= 0.5.2"])
end
end