scripts: add support for multiple mmodule sources
This adds support for providing a list of multiple sources a module can be obtained from. This way, modules can have a fallback to clone from in case the primary source is not available.
This commit is contained in:
parent
39c1f67236
commit
4a79b17d3b
@ -19,10 +19,22 @@ for module in $GLUON_MODULES; do
|
|||||||
git init
|
git init
|
||||||
|
|
||||||
if ! git branch -f base "$commit" 2>/dev/null; then
|
if ! git branch -f base "$commit" 2>/dev/null; then
|
||||||
git fetch "$repo" "$branch"
|
for repository in $repo; do
|
||||||
git branch -f base "$commit" || {
|
if git fetch "$repository" "$branch"; then
|
||||||
echo "unable to find commit \"$commit\" on branch \"$branch\" in repo \"$repo\"." >&2
|
if ! git branch -f base "$commit"; then
|
||||||
exit 1
|
echo "unable to find commit \"$commit\" on branch \"$branch\" in repo \"$repo\"." >&2
|
||||||
}
|
break
|
||||||
|
fi
|
||||||
|
fetched=1
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "unable to fetch module \"$module\" from \"$repository\"" >&2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $fetched -ne 1 ]; then
|
||||||
|
echo "No suitable mirror for module \"$module\" found." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user