File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ def java?
213
213
end
214
214
215
215
def add_file_to_gem ( relative_source_path )
216
+ if relative_source_path . nil? || !File . exist? ( relative_source_path )
217
+ raise "Cannot find file '#{ relative_source_path } '"
218
+ end
219
+
216
220
dest_path = File . join ( gem_build_path , relative_source_path )
217
221
dest_dir = File . dirname ( dest_path )
218
222
377
381
378
382
[ "libxml2" , "libxslt" ] . each do |lib |
379
383
version = dependencies [ lib ] [ "version" ]
380
- archive = File . join ( "ports" , "archives" , "#{ lib } -#{ version } .tar.gz" )
381
- add_file_to_gem archive
384
+ archive = Dir . glob ( File . join ( "ports" , "archives" , "#{ lib } -#{ version } .tar.*" ) ) . first
385
+ add_file_to_gem ( archive )
382
386
383
387
patchesdir = File . join ( "patches" , lib )
384
388
patches = %x(#{ [ "git" , "ls-files" , patchesdir ] . shelljoin } ) . split ( "\n " ) . grep ( /\. patch\z / )
Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ describe File.basename(gemfile) do
119
119
120
120
it "contains the port files" do
121
121
actual_ports = gemfile_contents . grep ( %r{^ports/} )
122
- assert_equal ( 1 , actual_ports . grep ( /libxml2-\d +\. \d +\. \d +\. tar\. gz / ) . length ,
122
+ assert_equal ( 1 , actual_ports . grep ( /libxml2-\d +\. \d +\. \d +\. tar\. [gx]z / ) . length ,
123
123
"expected #{ actual_ports } to include libxml2" )
124
- assert_equal ( 1 , actual_ports . grep ( /libxslt-\d +\. \d +\. \d +\. tar\. gz / ) . length ,
124
+ assert_equal ( 1 , actual_ports . grep ( /libxslt-\d +\. \d +\. \d +\. tar\. [gx]z / ) . length ,
125
125
"expected #{ actual_ports } to include libxslt" )
126
126
assert_equal ( 2 , actual_ports . length )
127
127
end
You can’t perform that action at this time.
0 commit comments