star-build

Automation tool for project installation
git clone git://git.meso-star.fr/star-build.git
Log | Files | Refs | README | LICENSE

commit f39b2fd19908f1880fe89026abaf7deb171bad17
parent 954d6438688d20b7ad5de3bf91f9acd083965f8b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 18 Jul 2024 17:01:22 +0200

Update of git repository mirror target

Added a MIRROR_GIT_OPT macro to allow the user to control how git
locally clones a repository as a mirror. Its default value is set to
limit the size of data transferred, and therefore stored, rather than
mirroring the entire repository. Thus, by default, it is assumed that
the mirror is configured for a specific build, and not to be able to
build all builds that might rely on a different version of the source
trees.

Diffstat:
Mconfig.mk | 4++++
Msrc/clipper2.mk.in | 5+++--
Msrc/git.mk.in | 4++--
Msrc/libcyaml.mk.in | 5+++--
Msrc/random123.mk.in | 5+++--
5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/config.mk b/config.mk @@ -53,6 +53,10 @@ NETWORK = ONLINE # build of the project (see the NETWORK macro) MIRROR = ./mirror +# Option passed to git when cloning a repository to make it a local +# mirror +MIRROR_GIT_OPT = --depth 1 + # URLs for online repositories REPO_ONLINE = https://gitlab.com/meso-star REPO_BIN_ONLINE = https://www.meso-star.com/packages/v0.4/ diff --git a/src/clipper2.mk.in b/src/clipper2.mk.in @@ -74,10 +74,11 @@ distclean_clipper2: rm -rf "$(CLIPPER2_DIR)" mirror_clipper2: - @repo="$$(echo "$(CLIPPER2_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ + repo="$$(echo "$(CLIPPER2_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ repo="$(MIRROR)/$${repo##*/}" && \ rm -rf "$${repo}" && \ - git clone --mirror $(CLIPPER2_URL) "$${repo}" + git clone --bare --branch "$(CLIPPER2_TAG)" $(MIRROR_GIT_OPT) \ + $(CLIPPER2_URL) "$${repo}" clean_all: clean_clipper2 distclean_all: distclean_clipper2 diff --git a/src/git.mk.in b/src/git.mk.in @@ -34,10 +34,10 @@ distclean_@NAME@: rm -rf "$(CACHE)/@NAME@/@TAG@" mirror_@NAME@: - @repo="$$(echo "@URL@" | sed 's/[\/]\{0,\}$$//g')" && \ + repo="$$(echo "@URL@" | sed 's/[\/]\{0,\}$$//g')" && \ repo="$(MIRROR)/$${repo##*/}" && \ rm -rf "$${repo}" && \ - git clone --mirror @URL@ "$${repo}" + git clone --bare --branch @TAG@ $(MIRROR_GIT_OPT) @URL@ "$${repo}" clean_all: clean_@NAME@ distclean_all: distclean_@NAME@ diff --git a/src/libcyaml.mk.in b/src/libcyaml.mk.in @@ -50,10 +50,11 @@ distclean_libcyaml: rm -rf "$(LIBCYAML_DIR)" mirror_libcyaml: - @repo="$$(echo "$(LIBCYAML_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ + repo="$$(echo "$(LIBCYAML_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ repo="$(MIRROR)/$${repo##*/}" && \ rm -rf "$${repo}" && \ - git clone --mirror $(LIBCYAML_URL) "$${repo}" + git clone --bare --branch "$(LIBCYAML_TAG)" $(MIRROR_GIT_OPT) \ + $(LIBCYAML_URL) "$${repo}" clean_all: clean_libcyaml distclean_all: distclean_libcyaml diff --git a/src/random123.mk.in b/src/random123.mk.in @@ -82,10 +82,11 @@ distclean_random123: rm -rf "$(RANDOM123_DIR)" mirror_random123: - @repo="$$(echo "$(RANDOM123_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ + repo="$$(echo "$(RANDOM123_URL)" | sed 's/[\/]\{0,\}$$//g')" && \ repo="$(MIRROR)/$${repo##*/}" && \ rm -rf "$${repo}" && \ - git clone --mirror $(RANDOM123_URL) "$${repo}" + git clone --bare --branch "$(RANDOM123_TAG)" $(MIRROR_GIT_OPT) \ + $(RANDOM123_URL) "$${repo}" distclean_all: distclean_random123 install_all: random123