From 55921f1957ce25334a25af934c214a6d285f3dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Lebrun?= Date: Wed, 2 Oct 2024 10:20:06 +0200 Subject: [PATCH] utils/index-repository: support multiple remote URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux is the only currently supported project for which we want three remote URLs; see index-all-repositories for the list. We could optimise the fetching by doing a single fetch call to all remotes at the same time using --jobs (or fetch.parallel config). Signed-off-by: Théo Lebrun --- utils/index-repository | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/index-repository b/utils/index-repository index a2bf725..8231406 100755 --- a/utils/index-repository +++ b/utils/index-repository @@ -1,7 +1,7 @@ #!/bin/sh -if [ "$#" -ne 2 ]; then - echo "Usage: $0 repo_name repo_url" +if [ "$#" -lt 2 ]; then + echo "Usage: $0 repo_name repo_urls..." exit 1 fi @@ -14,6 +14,16 @@ mkdir -p $dir/data git clone --bare $2 $dir/repo git config --system --add safe.directory $dir/repo +shift +shift +i=0 +for remote +do + git -C $dir/repo remote add other$i $remote + git -C $dir/repo fetch --tags other$i + i=$(($i+1)) +done + export LXR_REPO_DIR=$dir/repo export LXR_DATA_DIR=$dir/data python3 /usr/local/elixir/update.py $ELIXIR_THREADS