build system: extend RUN_SHOW_START_STOP to runq_git

This commit is contained in:
Moritz Bunkus 2018-01-02 20:56:14 +01:00
parent 6980b1c5d1
commit c2f7fbb05a

View File

@ -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