osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43167?usp=email )
Change subject: deps: move "git clone" logic into update.sh ......................................................................
deps: move "git clone" logic into update.sh
Prepare to have more logic for cloning and updating git repositories in the script, see follow-up patches. The purpose of this patch series is to fix the rate limiting errors we are seeing from gitlab eclipse, that lead to aborts of our ttcn3 jobs:
[titan.ProtocolModules.ROSE] Updating URL to https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ROSE remote: You have reached the limit of requests you can make to Eclipse GitLab. This could be caused by too many open tabs, which query the GitLab server in the background. Please close unused tabs, or put them to sleep so they don't issue requests needlessly. fatal: unable to access 'https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.M3UA/': The requested URL returned error: 429 make[1]: *** [Makefile:174: titan.ProtocolModules.M3UA/update] Error 128
Change-Id: I7c1647edd11afac657acaf6add08903373eae585 --- M deps/Makefile M deps/update.sh 2 files changed, 15 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/67/43167/1
diff --git a/deps/Makefile b/deps/Makefile index 306f1b2..4a6bd90 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -135,12 +135,8 @@ $(1)_HEAD!= if [ -d $(1) ]; then cd $(1) && git describe --tags 2>/dev/null || git rev-parse HEAD; fi $(1)_MODIFIED!= if [ -d $(1) ]; then cd $(1) && git diff --quiet --exit-code || echo -n "1"; fi
-$(1): - @echo "[$(1)] Initial git clone" - @git clone -q $(2)/$(1) - .PHONY: $(1)/update -$(1)/update: $(1) +$(1)/update: ifeq ($$($(1)_MODIFIED),1) @echo "WARNING: $(1) skipped because it contains uncommitted modifications!" else @@ -149,16 +145,21 @@ @cd $(1) && git remote set-url origin $(2)/$(1) && git fetch endif ifneq ($$($(1)_HEAD),$($(1)_commit)) - @./update.sh "$(1)" "$($(1)_commit)" + @./update.sh "$(1)" "$($(1)_commit)" "$(2)" endif endif
.PHONY: $(1)/clean -$(1)/clean: $(1) +$(1)/clean: ifeq ($$($(1)_MODIFIED),1) @echo "WARNING: $(1) skipped because it contains uncommitted modifications!" else - cd $(1) && git fetch && git checkout -q -f "$($(1)_commit)" && git reset --hard + if [ -d $(1) ]; then \ + cd $(1) && \ + git fetch && \ + git checkout -q -f "$($(1)_commit)" && \ + git reset --hard; \ + fi endif
.PHONY: $(1)/distclean diff --git a/deps/update.sh b/deps/update.sh index 8099ed7..4a52279 100755 --- a/deps/update.sh +++ b/deps/update.sh @@ -1,6 +1,12 @@ #!/bin/sh -e DIR="$1" COMMIT="$2" +URL_PREFIX="$3" + +if ! [ -d "$DIR" ]; then + echo "[$DIR] Initial git clone" + git clone -q "$URL_PREFIX"/"$DIR" +fi
cd "$DIR"