osmith has uploaded this change for review.

View Change

deps: avoid redirect with eclipse gitlab

Use ".git" at the end of gitlab URLs to avoid the redirects, e.g.:

warning: redirecting to https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.M3UA.git/

This is not just a cosmetic improvement that gets rid of these warnings,
but it actually has the effect that we make less requests to the gitlab
eclipse server and are less likely to trigger the rate limiting. On my
machine I do trigger it with "make deps" without this patch, and with
this patch I don't.

Change-Id: I4cfb625e0d09e2bbcab2eef89b521f94c9b6c42c
---
M deps/update.sh
1 file changed, 13 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/43169/1
diff --git a/deps/update.sh b/deps/update.sh
index 332ce23..64c5b54 100755
--- a/deps/update.sh
+++ b/deps/update.sh
@@ -3,9 +3,20 @@
COMMIT="$2"
URL_PREFIX="$3"

+get_full_url() {
+ case "$URL_PREFIX" in
+ *gitlab*)
+ echo "$URL_PREFIX"/"$DIR".git
+ ;;
+ *)
+ echo "$URL_PREFIX"/"$DIR"
+ ;;
+ esac
+}
+
update_url() {
local current="$(git -C "$DIR" remote get-url origin)"
- local full_url="$URL_PREFIX"/"$DIR"
+ local full_url="$(get_full_url)"

if [ "$current" != "$full_url" ]; then
echo "[$DIR] Updating URL to $full_url"
@@ -18,7 +29,7 @@
update_url
else
echo "[$DIR] Initial git clone"
- git clone -q "$URL_PREFIX"/"$DIR"
+ git clone -q "$(get_full_url)"
fi

cd "$DIR"

To view, visit change 43169. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4cfb625e0d09e2bbcab2eef89b521f94c9b6c42c
Gerrit-Change-Number: 43169
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>