From c2f7fbb05abfe7f6bba4b97954e86dc3a768f74f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 2 Jan 2018 20:56:14 +0100 Subject: [PATCH] build system: extend `RUN_SHOW_START_STOP` to `runq_git` --- rake.d/helpers.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rake.d/helpers.rb b/rake.d/helpers.rb index 8e909f9dc..64299b618 100644 --- a/rake.d/helpers.rb +++ b/rake.d/helpers.rb @@ -82,11 +82,12 @@ ensure end def runq(action, target, cmdline, options = {}) - start = Time.now + start = Time.now + runner = lambda { run_wrapper cmdline, options.clone.merge(:dont_echo => !$verbose) } puts_action action, :target => target, :prefix => $run_show_start_stop ? "[start ]" : nil - code = run_wrapper cmdline, options.clone.merge(:dont_echo => !$verbose) + code = options[:mutex] ? options[:mutex].synchronize(&runner) : runner.call duration = Time.now - start if $run_show_start_stop @@ -97,8 +98,7 @@ def runq(action, target, cmdline, options = {}) end def runq_git(msg, cmdline, options = {}) - puts_qaction "git #{cmdline.split(/\s+/)[0]}", :target => "#{msg}" - $git_mutex.synchronize { run "git #{cmdline}", options.clone.merge(:dont_echo => !$verbose) } + runq "git #{cmdline.split(/\s+/)[0]}", "#{msg}", "git #{cmdline}", :mutex => $git_mutex end def ensure_dir dir