Commit ed59b2c8a38c62a5fc101716744503640324fccb

Thomas de Grivel 2023-02-28T12:28:14

ci_mux

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