File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 19
19
# search the latest libyaml source under $srcdir
20
20
yaml_source = Dir . glob ( "#{ $srcdir} /yaml{,-*}/" ) . max_by { |n | File . basename ( n ) . scan ( /\d +/ ) . map ( &:to_i ) }
21
21
unless yaml_source
22
- require_relative '../../tool/extlibs.rb'
23
- extlibs = ExtLibs . new ( cache_dir : File . expand_path ( "../../tmp/download_cache" , $srcdir) )
24
- unless extlibs . process_under ( $srcdir)
25
- raise "failed to download libyaml source"
22
+ download_failure = "failed to download libyaml source"
23
+ begin
24
+ require_relative '../../tool/extlibs.rb'
25
+ extlibs = ExtLibs . new ( cache_dir : File . expand_path ( "../../tmp/download_cache" , $srcdir) )
26
+ unless extlibs . process_under ( $srcdir)
27
+ raise download_failure
28
+ end
29
+ rescue
30
+ # Implicitly captures Exception#cause. Newer rubies show it in the backtrace.
31
+ raise download_failure
26
32
end
27
33
yaml_source , = Dir . glob ( "#{ $srcdir} /yaml-*/" )
28
34
raise "libyaml not found" unless yaml_source
You can’t perform that action at this time.
0 commit comments