Skip to content

Commit

Permalink
Replace tarruby with archive-tar-minitar.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ilkka Laukkanen authored and mitchellh committed Mar 9, 2010
1 parent 68d709e commit de18f1e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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
Expand Down
7 changes: 2 additions & 5 deletions lib/vagrant/actions/box/unpackage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Box
# 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
Expand Down Expand Up @@ -38,12 +37,10 @@ def box_dir
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
6 changes: 3 additions & 3 deletions lib/vagrant/actions/vm/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ def temp_path

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
Expand Down
6 changes: 3 additions & 3 deletions vagrant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,22 @@ 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"])
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
end

0 comments on commit de18f1e

Please sign in to comment.