Skip to content

Commit

Permalink
g.extension: use git sparse-checkout instead of SVN (#2895)
Browse files Browse the repository at this point in the history
* unified imports
* use git sparse checkout
* version dependent fall-back
* test on mac
  • Loading branch information
ninsbl authored Apr 12, 2023
1 parent 6d461f8 commit a7ed30c
Show file tree
Hide file tree
Showing 3 changed files with 438 additions and 223 deletions.
1 change: 0 additions & 1 deletion .github/workflows/macos_gunittest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ exclude =
raster/r.in.pdal/testsuite/test_r_in_pdal_selection.py
raster/r.terraflow/testsuite/test_r_terraflow.py
raster/r.sun/testsuite/test_rsun.py
scripts/g.extension/testsuite/test_addons_download.py
scripts/g.search.modules/testsuite/test_g_search_modules.py
temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py
temporal/t.connect/testsuite/test_distr_tgis_db_raster.py
Expand Down
32 changes: 23 additions & 9 deletions scripts/g.extension/g.extension.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,23 @@ <h4>Local source code directory</h4>
To keep the directory clean, the directory content is copied
to a temporary directory and the compilation happens there.

<h4>Local source code ZIP file</h4>
<h4>Source code in a ZIP or TAR archive</h4>
In addition, new extension can be also installed from a ZIP file
or an archive file from the TAR family (e.g., <tt>.tar.gz</tt> or <tt>.bz2</tt>).
The file can be on disk (specified with a path), or on web (specified by
The file can be on disk (specified with a path), or on the web (specified by
an URL).

<h4>Online repositories: GitHub, GitLab and Bitbucket</h4>
For well known general hosting services, namely GitHub, GitLab and Bitbucket,
<em>g.extension</em> supports the download of a repository as a ZIP file.
<em>g.extension</em> supports the download of a repository.
Here the user only needs to provide a base URL to the repository web page
(with or without the <tt>https://</tt> part).
For GitLab and Bitbucket, the latest source code in the default branch is
downloaded, for GitHub, the latest source code in the master branch is downloaded.
Of course, a user can still specify the full URL of a ZIP file
and install a specific branch or release in this way (ZIP file mechanism
For GitHub, GitLab and Bitbucket, the latest source code in the default
branch is downloaded, unless a specific branch is requested in the
<em>branch</em> option.

Of course, a user can still specify the full URL of a ZIP file e.g. for a
specific release and install the achived code in this way (ZIP file mechanism
will be applied).

<p>
Expand All @@ -98,12 +100,12 @@ <h4>Online repositories: GitHub, GitLab and Bitbucket</h4>
depend on a specific infrastructure.
For other sources and repositories, this is not supported because it is
assumed that other sources contain only one extension, typically a module
or group of modules.
or group of modules with a Makefile at the root of the repository.

<h4>Needed directory layout</h4>
When none of the above sources is identified, <em>g.extension</em> assumes
<!-- TODO: update this description -->
that the source is in a GitHub repository and uses the <em>svn</em> command
that the source is in a GitHub repository and uses the <em>git</em> command
line tool to obtain the source code. The expected structure of the repository
should be the same as the one of the official repository.

Expand Down Expand Up @@ -225,6 +227,18 @@ <h3>Installing when writing a module locally</h3>
g.extension r.example url=/local/directory/r.example/
</pre></div>

<h2>REQUIREMENTS</h2>
In order to clone source code repositories, the <em>git</em> command line
tool is required. The installation of single AddOns is most efficient with
versions of git that support so called <i>sparse checkout</i>, which was
introduced with version 2.25. With older versions of git, the entire AddOns
repository will be downloaded.

On UNIX like systems, installation is done with the
<em>make</em> command line tool. For AddOns written in C / C++, a respective
build environment is needed.


<h2>KNOWN ISSUES</h2>

Toolboxes in the official repository cannot be downloaded.
Expand Down
Loading

0 comments on commit a7ed30c

Please sign in to comment.