summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNAKAMURA Usaku <usa@ruby-lang.org>2019-10-02 12:59:59 +0900
committerNAKAMURA Usaku <usa@ruby-lang.org>2019-10-02 12:59:59 +0900
commit5af2c8735a22e6b54acf4164b1f1f7bac98e7111 (patch)
tree24913d98260c5a2368d31884c3f54bd8334c7a1a /tool
parent15606963de0c818c549aef2352da45d749e4b0db (diff)
Should fail if `system` failed
Diffstat (limited to 'tool')
-rwxr-xr-xtool/make-snapshot15
1 files changed, 12 insertions, 3 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index b3a68ef93a..95d5befea3 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -351,7 +351,10 @@ def package(vcs, rev, destdir, tmp = nil)
File.directory?(n) or File.rename v, n
v = n
- system(*%W"patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
+ if $patch_file && !system(*%W"patch -d #{v} -p0 -i #{$patch_file}")
+ puts $colorize.fail("patching failed")
+ return
+ end
def (clean = []).add(n) push(n); n end
Dir.chdir(v) do
unless File.exist?("ChangeLog")
@@ -451,7 +454,10 @@ touch-unicode-files:
ENV["CACHE_SAVE"] = "no"
make = ENV["MAKE"] || ENV["make"] || "make"
args = args.map {|arg| arg.join("=")}
- system(make, "update-download", *args)
+ unless system(make, "update-download", *args)
+ puts $colorize.fail("update-download failed")
+ return
+ end
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk", "ext/ripper/y.output", ".revision.time")
Dir.glob("**/*") do |dest|
next unless File.symlink?(dest)
@@ -467,7 +473,10 @@ touch-unicode-files:
end
modified = new_time
end
- system(make, "prepare-package", "clean-cache", *args)
+ unless system(make, "prepare-package", "clean-cache", *args)
+ puts $colorize.fail("prepare-package failed")
+ return
+ end
print "prerequisites"
else
system(*%W"#{YACC} -o parse.c parse.y")