utils/index-repository: support multiple remote URLs

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 <theo.lebrun@bootlin.com>
This commit is contained in:
Théo Lebrun 2024-10-02 10:20:06 +02:00
parent 06d503e3d9
commit 55921f1957

View file

@ -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