diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 5308cdd..7714daf 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -146,14 +146,21 @@ EOF
Dir.chdir("#{ci_dir}/status") do
status.each do |name, s|
puts "#{name} -> #{s}"
- final_status[name] = if s.include?(:running)
- :running
- elsif s.include?(:ko)
- :ko
- else
- :ok
- end
- File.write("#{name}.status", final_status[name])
+ s.each do |subdir, subdir_status|
+ case subdir_status
+ when :running
+ final_status[name] = :running
+ when :ko
+ if final_status[name] != :running
+ final_status[name] = :ko
+ end
+ when :ok
+ if ! final_status[name]
+ final_status[name] = :ok
+ end
+ end
+ end
+ File.write("#{name}.status", final_status[name].to_s + '\n')
end
end
final_status