Sha256: 0156a2eb864d91118868b57e92dd89bfc53bb5cf213191327b98e6421afcb99d
Contents?: true
Size: 1.26 KB
Versions: 28
Compression:
Stored size: 1.26 KB
Contents
#!/usr/bin/env ruby require 'rbbt/workflow' require 'rbbt-util' require 'rbbt-util' require 'rbbt/util/simpleopt' $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup <<EOF Examine the info of a job result $ rbbt workflow info <job-result> <key> <value> -h--help Help -f--force Write info even if key is already present -r--recursive Write info for all dependencies as well -p--check_pid Check that recursive jobs where created by the same process EOF SOPT.usage if options[:help] file, key, value = ARGV force, recursive, check_pid = options.values_at :force, :recursive, :check_pid def get_step(file) file = file.sub(/\.(info|files)/,'') step = Workflow.load_step file step end raise ParameterException if key.nil? || value.nil? if %w(DELETE nil).include? value value = nil force = true end step = get_step file step.set_info key, value if force || ! step.info.include?(key) pid = step.info[:pid] host = step.info[:pid_hostname] step.rec_dependencies.each do |dep| dep.set_info key, value if (force || ! dep.info.include?(key)) && (!check_pid || dep.info[:pid].to_s == pid and dep.info[:pid_hostname] == host) rescue Log.warn "Could no set info #{key} for #{dep.path}: #{$!.message}" end if recursive
Version data entries
28 entries across 28 versions & 1 rubygems