diff --git a/rakelib/extensions.rake b/rakelib/extensions.rake index 567a8f33211..17004227cc1 100644 --- a/rakelib/extensions.rake +++ b/rakelib/extensions.rake @@ -213,6 +213,10 @@ def java? end def add_file_to_gem(relative_source_path) + if relative_source_path.nil? || !File.exist?(relative_source_path) + raise "Cannot find file '#{relative_source_path}'" + end + dest_path = File.join(gem_build_path, relative_source_path) dest_dir = File.dirname(dest_path) @@ -377,8 +381,8 @@ else ["libxml2", "libxslt"].each do |lib| version = dependencies[lib]["version"] - archive = File.join("ports", "archives", "#{lib}-#{version}.tar.gz") - add_file_to_gem archive + archive = Dir.glob(File.join("ports", "archives", "#{lib}-#{version}.tar.*")).first + add_file_to_gem(archive) patchesdir = File.join("patches", lib) patches = %x(#{["git", "ls-files", patchesdir].shelljoin}).split("\n").grep(/\.patch\z/) diff --git a/scripts/test-gem-file-contents b/scripts/test-gem-file-contents index 08a3c0905f7..58a59d637da 100755 --- a/scripts/test-gem-file-contents +++ b/scripts/test-gem-file-contents @@ -119,9 +119,9 @@ describe File.basename(gemfile) do it "contains the port files" do actual_ports = gemfile_contents.grep(%r{^ports/}) - assert_equal(1, actual_ports.grep(/libxml2-\d+\.\d+\.\d+\.tar\.gz/).length, + assert_equal(1, actual_ports.grep(/libxml2-\d+\.\d+\.\d+\.tar\.[gx]z/).length, "expected #{actual_ports} to include libxml2") - assert_equal(1, actual_ports.grep(/libxslt-\d+\.\d+\.\d+\.tar\.gz/).length, + assert_equal(1, actual_ports.grep(/libxslt-\d+\.\d+\.\d+\.tar\.[gx]z/).length, "expected #{actual_ports} to include libxslt") assert_equal(2, actual_ports.length) end