← Back to team overview

kicad-developers team mailing list archive

[Patch] Add gitlab support to github plugin

 

This allows users to host the footprint libraries on a local gitlab server
in case there is no access to github.

I know this patch has the potential to be controversial because the code in
the plugin is supposed to be as generic as possible and that the server
should change. I would like to counter that by noting that gitlab is
probably the most popular option for self hosted git servers, and the code
change adds just one string comparison and a string concatenation to make
the integration work.

This patch can be found online at:
https://github.com/KiCad/kicad-source-mirror/pull/6/files

Git diff:
diff --git a/pcbnew/github/github_plugin.cpp
b/pcbnew/github/github_plugin.cpp
index 695365c..8ab03a2 100644
--- a/pcbnew/github/github_plugin.cpp
+++ b/pcbnew/github/github_plugin.cpp
@@ -516,6 +516,14 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString&
aRepoURL, string* aZipURL )

             zip_url += repo.GetPath();      // path comes with a leading
'/'

+            // This is intented for use with gitlab, for users who wish to
self-host
+            // the library repos on a local server. The KIGITHUB path (and
thus server name)
+            // must contain "git" for this code to work.
+            if ( repo.GetServer().Contains("git") )
+            {
+                zip_url += "/repository/archive.zip";
+            }
+
             // Do not modify the path, we cannot anticipate the needs of
all
             // servers which are serving up zip files directly.  URL
modifications
             // are more generally done in the server, rather than
contaminating

Follow ups