Commit 055976774a66a8e39577503b29a260ed2393e8dd

Thomas de Grivel 2023-03-01T09:12:51

rbpkg_ci

diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index b02444a..69f3b46 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -34,7 +34,7 @@ class Rbpkg::Repo
   def checkout(branch)
     verbose(3, "repo(#{name.inspect}).checkout")
     sh_branch=sh_quote(branch)
-    cmd! "cd #{sh_quote(src_dir!)} && git fetch --unshallow"
+    cmd! "cd #{sh_quote(src_dir!)} && git fetch --all"
     cmd! "cd #{sh_quote(src_dir!)} && git reset --hard"
     cmd! "cd #{sh_quote(src_dir!)} && git checkout #{sh_branch} --"
     cmd! "cd #{sh_quote(src_dir!)} && git reset --hard"
@@ -53,7 +53,8 @@ class Rbpkg::Repo
     if File.directory?(ci_dir)
       cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg upgrade"
       Rbpkg::Log.add("rbpkg_ci.#{name}.upgrade")
-      cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg checkout #{sh_quote(commit)} #{sh_name}"
+      cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg checkout #{sh_quote(commit)}"
+      cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg info #{sh_name}"
       cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg upgrade #{sh_name}"
       cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg test #{sh_name}"
       Rbpkg::Log.ok("rbpkg_ci.#{name}.upgrade")
@@ -66,6 +67,7 @@ class Rbpkg::Repo
     cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg build #{sh_name}"
     cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg test #{sh_name}"
     cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg install #{sh_name}"
+    cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg info #{sh_name}"
     Rbpkg::Log.ok("rbpkg_ci.#{name}.install")
     Rbpkg::Log.ok(ci_log_name_commit(commit))
     Rbpkg::Log.ok(ci_log_name_ref(ref))
@@ -197,7 +199,7 @@ class Rbpkg::Repo
 
   def fetch
     verbose 3, "repo(#{name.inspect}).fetch"
-    cmd! "cd #{sh_quote(src_dir!)} && git fetch --unshallow"
+    cmd! "cd #{sh_quote(src_dir!)} && git fetch --all"
   end
 
   def git_clone
@@ -308,7 +310,11 @@ class Rbpkg::Repo
   end
 
   def name
-    @@name
+    self.class.repo_name
+  end
+
+  def self.repo_register
+    Rbpkg::Repos.def_repo(repo_name, self)
   end
 
   def obj_dir
@@ -495,9 +501,4 @@ class Rbpkg::Repo
       "#{head}-#{hash}"
     end
   end
-
-  def self.def_name(name)
-    Rbpkg::Repos.def_repo(name, self)
-    @@name = name
-  end
 end
diff --git a/lib/rbpkg/repos/c3.rb b/lib/rbpkg/repos/c3.rb
index 3ba21d1..514bf8d 100644
--- a/lib/rbpkg/repos/c3.rb
+++ b/lib/rbpkg/repos/c3.rb
@@ -1,6 +1,8 @@
 class Rbpkg::Repos::C3 < Rbpkg::Repo
 
-  def_name "c3"
+  def self.repo_name
+    "c3"
+  end
 
   def self.dependencies
     ["libbsd", "libmd"]
@@ -9,4 +11,6 @@ class Rbpkg::Repos::C3 < Rbpkg::Repo
   def git_url
     "https://git.kmx.io/c3-lang/c3.git"
   end
+
+  repo_register
 end
diff --git a/lib/rbpkg/repos/icecast_server.rb b/lib/rbpkg/repos/icecast_server.rb
index 46a0326..dc82e79 100644
--- a/lib/rbpkg/repos/icecast_server.rb
+++ b/lib/rbpkg/repos/icecast_server.rb
@@ -1,6 +1,8 @@
 class Rbpkg::Repos::IcecastServer < Rbpkg::Repo
 
-  def_name "icecast-server"
+  def self.repo_name
+    "icecast-server"
+  end
 
   def self.dependencies
     []
@@ -13,4 +15,6 @@ class Rbpkg::Repos::IcecastServer < Rbpkg::Repo
   def git_url
     "https://gitlab.xiph.org/xiph/icecast-server.git"
   end
+
+  repo_register
 end
diff --git a/lib/rbpkg/repos/libbsd.rb b/lib/rbpkg/repos/libbsd.rb
index bbfc966..31d5030 100644
--- a/lib/rbpkg/repos/libbsd.rb
+++ b/lib/rbpkg/repos/libbsd.rb
@@ -1,6 +1,8 @@
 class Rbpkg::Repos::Libbsd < Rbpkg::Repo
 
-  def_name("libbsd")
+  def self.repo_name
+    "libbsd"
+  end
 
   def branch
     "main"
@@ -21,4 +23,6 @@ class Rbpkg::Repos::Libbsd < Rbpkg::Repo
   def system_package?
     Rbpkg.os.match?(/BSD/)
   end
+
+  repo_register
 end
diff --git a/lib/rbpkg/repos/libmd.rb b/lib/rbpkg/repos/libmd.rb
index 927ad98..41f6b11 100644
--- a/lib/rbpkg/repos/libmd.rb
+++ b/lib/rbpkg/repos/libmd.rb
@@ -1,6 +1,8 @@
 class Rbpkg::Repos::Libmd < Rbpkg::Repo
 
-  def_name("libmd")
+  def self.repo_name
+    "libmd"
+  end
 
   def branch
     "main"
@@ -17,4 +19,6 @@ class Rbpkg::Repos::Libmd < Rbpkg::Repo
   def system_package?
     Rbpkg.os.match?(/BSD/)
   end
+
+  repo_register
 end
diff --git a/lib/rbpkg/repos/libshout.rb b/lib/rbpkg/repos/libshout.rb
index db4cc29..ad63d5b 100644
--- a/lib/rbpkg/repos/libshout.rb
+++ b/lib/rbpkg/repos/libshout.rb
@@ -1,16 +1,20 @@
 class Rbpkg::Repos::Libshout < Rbpkg::Repo
 
-  def_name("libshout")
+  def self.repo_name
+    "libshout"
+  end
 
   def self.dependencies
     []
   end
 
   def dir
-    "xiph.org/libshout"
+    "xiph.org/#{name}"
   end
 
   def git_url
     "https://gitlab.xiph.org/xiph/icecast-libshout.git"
   end
+
+  repo_register
 end