From 5af2c8735a22e6b54acf4164b1f1f7bac98e7111 Mon Sep 17 00:00:00 2001 From: NAKAMURA Usaku Date: Wed, 2 Oct 2019 12:59:59 +0900 Subject: [PATCH] Should fail if `system` failed --- tool/make-snapshot | 15 ++++++++++++--- 1 file 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")