gluon/scripts/update-patches.sh
2019-12-14 18:35:11 +01:00

27 lines
633 B
Bash
Executable File

#!/bin/bash
set -e
shopt -s nullglob
[ "$GLUON_PATCHESDIR" ] || exit 1
. scripts/modules.sh
GLUONDIR="$(pwd)"
for module in $GLUON_MODULES; do
echo "--- Updating patches for module '$module' ---"
rm -rf "${GLUON_PATCHESDIR:?}/$module"
cd "$GLUONDIR"/"$module"
n=0
for commit in $(git rev-list --reverse --no-merges base..patched); do
(( ++n ))
mkdir -p "${GLUON_PATCHESDIR}/$module"
git -c core.abbrev=40 show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames --binary "$commit" > "${GLUON_PATCHESDIR}/$module/$(printf '%04u' $n)-$(git show -s --pretty=format:%f "$commit").patch"
done
done