summaryrefslogtreecommitdiff
path: root/tool/extlibs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-27 00:30:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-27 00:30:59 +0900
commit135c6a4b995f5858687942a2b60a26f007695b78 (patch)
treead4a8d9ec7d5b4200843a587c9229d9b2f784d24 /tool/extlibs.rb
parentf8e703e2b0c872301ab8f469ed62682d71c3f1c8 (diff)
downloadruby-135c6a4b995f5858687942a2b60a26f007695b78.tar.gz
fiddle: need to update configure after updating config tools
Diffstat (limited to 'tool/extlibs.rb')
-rwxr-xr-xtool/extlibs.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/extlibs.rb b/tool/extlibs.rb
index 720f1c767d..8a9c5a8fd0 100755
--- a/tool/extlibs.rb
+++ b/tool/extlibs.rb
@@ -125,6 +125,15 @@ class ExtLibs
end
end
+ def do_exec(command, dir, dest)
+ dir = dir ? File.join(dest, dir) : dest
+ if $VERBOSE
+ $stdout.puts "running #{command.dump} under #{dir}"
+ $stdout.flush
+ end
+ system(command, chdir: dir) or raise "failed #{command.dump}"
+ end
+
def do_command(mode, dest, url, cache_dir, chksums)
extracted = false
base = /.*(?=\.tar(?:\.\w+)?\z)/
@@ -206,6 +215,13 @@ class ExtLibs
do_patch(dest, patch, args)
end
next
+ elsif /^!\s*(?:chdir:\s*([^|\s]+)\|\s*)?(.*)/ =~ line
+ if extracted and (mode == :all or mode == :patch)
+ command = vars.expand($2.strip)
+ chdir = $1 and chdir = vars.expand(chdir)
+ do_exec(command, chdir, dest)
+ end
+ next
elsif /->/ =~ line
if extracted and (mode == :all or mode == :patch)
link, file = $`.strip, $'.strip