Commit a7be75da07c4d1fe5c2690cb88c9e402bd581236

Thomas de Grivel 2023-02-28T11:44:42

ci_mux

diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 845c3c4..5810b47 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -321,9 +321,11 @@ EOF
 
   def self.lock(name)
     path = lock_path(name)
-    verbose(3, "Locking #{path}")
-    while File.file?(path)
-      sleep 1
+    if File.file?(path)
+      verbose(2, "Waiting for lock #{path}")
+      while File.file?(path)
+        sleep 1
+      end
     end
     File.write(path, "")
     at_exit { FileUtils.rm(path) }
@@ -510,6 +512,8 @@ def verbose(level, msg)
               msg
             when 1
               "\33[0;34m#{msg}\33[0m\n"
+            when 2
+              "\33[0;35m#{msg}\33[0m\n"
             when 3
               "\33[0;35m#{msg}\33[0m\n"
             else