utils/index-repository: fetch in parallel

Previous sequence:
 - git clone ...               # first fetch
 - git remote add remote0 ...
 - git fetch remote0           # second fetch
 - git remote add remote1 ...
 - git fetch remote1           # third fetch

Now:
 - git init
 - git remote add remote0 ...
 - git remote add remote1 ...
 - git remote add remote2 ...
 - git fetch --all -j4         # all fetches at the same time

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
Théo Lebrun 2024-11-07 18:11:44 +01:00
parent 420581700e
commit 50ef3cd46d

View file

@ -10,20 +10,21 @@ export ELIXIR_INSTALL=$(dirname $(dirname $(readlink -f "$0")))
dir=/srv/elixir-data/$1
mkdir -p $dir/data
git clone --bare $2 $dir/repo
mkdir -p $dir/data $dir/repo
git -C $dir/repo init --bare
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
git -C $dir/repo remote add remote$i $remote
i=$(($i+1))
done
git -C $dir/repo fetch --all --tags -j4
export LXR_REPO_DIR=$dir/repo
export LXR_DATA_DIR=$dir/data
python3 /usr/local/elixir/update.py $ELIXIR_THREADS