2013-12-28 14:11:59 +00:00
|
|
|
#!/bin/bash
|
2013-12-28 13:54:49 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
. scripts/modules.sh
|
|
|
|
|
|
|
|
|
|
|
|
GLUONDIR="$(pwd)"
|
2013-12-28 13:54:49 +00:00
|
|
|
|
|
|
|
for module in $GLUON_MODULES; do
|
2016-03-25 23:00:35 +00:00
|
|
|
echo "--- Updating module '$module' ---"
|
2016-09-24 15:34:14 +00:00
|
|
|
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
|
2019-09-30 19:38:40 +00:00
|
|
|
eval 'repo=${'"${var}"'_REPO}'
|
|
|
|
eval 'branch=${'"${var}"'_BRANCH}'
|
|
|
|
eval 'commit=${'"${var}"'_COMMIT}'
|
2013-12-28 20:35:16 +00:00
|
|
|
|
2016-09-24 15:34:14 +00:00
|
|
|
mkdir -p "$GLUONDIR/$module"
|
|
|
|
cd "$GLUONDIR/$module"
|
2013-12-31 16:03:39 +00:00
|
|
|
git init
|
|
|
|
|
2016-09-24 15:34:14 +00:00
|
|
|
if ! git branch -f base "$commit" 2>/dev/null; then
|
|
|
|
git fetch "$repo" "$branch"
|
2019-08-21 21:48:06 +00:00
|
|
|
git branch -f base "$commit" || {
|
2020-09-13 17:21:15 +00:00
|
|
|
echo "unable to find commit \"$commit\" on branch \"$branch\" in repo \"$repo\"." >&2
|
|
|
|
exit 1
|
2019-08-21 21:48:06 +00:00
|
|
|
}
|
2016-08-12 07:23:07 +00:00
|
|
|
fi
|
2013-12-28 13:54:49 +00:00
|
|
|
done
|