Commit 227022b5def31433e95bcff0fc48f67d42c71964

Thomas de Grivel 2023-02-25T17:57:26

rbpkg_ci

diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index f285e2d..80fb3c7 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -50,11 +50,11 @@ module Rbpkg
   end
 
   def self.ci_log_dir
-    "#{ci_dir}/log/#{os}/#{target}"
+    "#{ci_dir}/log/#{os}/#{target}/#{date}_#{$$}"
   end
 
   def self.ci_status_dir
-    "#{ci_dir}/status/#{os}/#{target}"
+    "#{ci_dir}/status/#{os}/#{target}/#{date}_#{$$}"
   end
 
   def self.clean_all(repos)
diff --git a/lib/rbpkg/log.rb b/lib/rbpkg/log.rb
index 1dd3047..f0b8d9d 100644
--- a/lib/rbpkg/log.rb
+++ b/lib/rbpkg/log.rb
@@ -7,7 +7,7 @@ module Rbpkg
 
     def initialize(name)
       @name = name
-      @path = "#{Rbpkg::Log.log_dir}/#{name}_#{Rbpkg.date}_#{$$}.log"
+      @path = "#{Rbpkg::Log.log_dir}/#{name}.log"
       @path_html = "#{path}.html"
       @status = :running
       raise "log file exists: #{@path.inspect}" if File.exist?(@path)
diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index b44a619..0c5f163 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -39,14 +39,8 @@ class Rbpkg::Repo
 
   def ci(ref, commit)
     verbose(3, "repo(#{name.inspect}).ci(#{ref.inspect}, #{commit.inspect})")
-    unless ref
-      checkout(branch)
-      ref = branch
-    end
-    unless commit
-      pull
-      commit = hash
-    end
+    ref = head unless ref
+    commit = hash unless commit
     Rbpkg::Log.add(ci_log_name_ref(ref))
     Rbpkg::Log.add(ci_log_name_commit(commit))
     sh_name = sh_quote(name)