2013-12-28 14:11:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
shopt -s nullglob
|
|
|
|
|
2019-09-30 19:38:40 +00:00
|
|
|
[ "$GLUON_TMPDIR" ] && [ "$GLUON_PATCHESDIR" ] || exit 1
|
2018-10-23 15:48:22 +00:00
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
. scripts/modules.sh
|
2013-12-28 14:11:59 +00:00
|
|
|
|
2016-08-09 00:50:57 +00:00
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
mkdir -p "$GLUON_TMPDIR"
|
2016-08-09 00:50:57 +00:00
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
GLUONDIR="$(pwd)"
|
|
|
|
|
|
|
|
PATCHDIR="$GLUON_TMPDIR"/patching
|
2016-08-09 00:50:57 +00:00
|
|
|
trap 'rm -rf "$PATCHDIR"' EXIT
|
|
|
|
|
2013-12-28 14:11:59 +00:00
|
|
|
for module in $GLUON_MODULES; do
|
2016-03-25 23:00:35 +00:00
|
|
|
echo "--- Patching module '$module' ---"
|
|
|
|
|
2016-09-24 15:34:14 +00:00
|
|
|
git clone -s -b base --single-branch "$GLUONDIR/$module" "$PATCHDIR" 2>/dev/null
|
2013-12-28 14:11:59 +00:00
|
|
|
|
2016-08-09 00:50:57 +00:00
|
|
|
cd "$PATCHDIR"
|
2018-10-23 15:48:22 +00:00
|
|
|
for patch in "${GLUON_PATCHESDIR}/$module"/*.patch; do
|
2016-08-09 00:50:57 +00:00
|
|
|
git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' -c commit.gpgsign=false am --whitespace=nowarn --committer-date-is-author-date "$patch"
|
2015-10-08 21:11:44 +00:00
|
|
|
done
|
2016-08-09 00:50:57 +00:00
|
|
|
|
2016-09-24 15:34:14 +00:00
|
|
|
cd "$GLUONDIR/$module"
|
2016-08-09 00:50:57 +00:00
|
|
|
git fetch "$PATCHDIR" 2>/dev/null
|
2017-01-18 16:21:43 +00:00
|
|
|
git checkout -B patched FETCH_HEAD >/dev/null
|
|
|
|
|
|
|
|
git config branch.patched.remote .
|
|
|
|
git config branch.patched.merge refs/heads/base
|
|
|
|
|
2016-08-09 00:50:57 +00:00
|
|
|
git submodule update --init --recursive
|
|
|
|
|
|
|
|
rm -rf "$PATCHDIR"
|
2013-12-28 14:11:59 +00:00
|
|
|
done
|