gluon/scripts/patch.sh

32 lines
749 B
Bash
Raw Normal View History

2013-12-28 14:11:59 +00:00
#!/bin/bash
set -e
shopt -s nullglob
. "$GLUONDIR"/scripts/modules.sh
2013-12-28 14:11:59 +00:00
TMPDIR="$GLUON_BUILDDIR"/tmp
mkdir -p "$TMPDIR"
PATCHDIR="$TMPDIR"/patching
trap 'rm -rf "$PATCHDIR"' EXIT
2013-12-28 14:11:59 +00:00
for module in $GLUON_MODULES; do
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
cd "$PATCHDIR"
2016-09-24 15:34:14 +00:00
for patch in "$GLUONDIR/patches/$module"/*.patch; do
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"
done
2016-09-24 15:34:14 +00:00
cd "$GLUONDIR/$module"
git fetch "$PATCHDIR" 2>/dev/null
git checkout -B patched FETCH_HEAD
git submodule update --init --recursive
rm -rf "$PATCHDIR"
2013-12-28 14:11:59 +00:00
done