gluon/scripts/update-patches.sh

28 lines
692 B
Bash
Raw Permalink Normal View History

2013-12-28 14:31:11 +00:00
#!/bin/bash
set -e
shopt -s nullglob
[ "$GLUON_PATCHESDIR" ] || exit 1
2017-01-18 16:21:43 +00:00
. scripts/modules.sh
GLUONDIR="$(pwd)"
2013-12-28 14:31:11 +00:00
for module in $GLUON_MODULES; do
echo "--- Updating patches for module '$module' ---"
2019-09-30 19:38:40 +00:00
rm -rf "${GLUON_PATCHESDIR:?}/$module"
2013-12-28 16:17:02 +00:00
2016-09-24 15:34:14 +00:00
cd "$GLUONDIR"/"$module"
2013-12-28 16:17:02 +00:00
n=0
for commit in $(git rev-list --reverse --no-merges base..patched); do
2019-09-30 19:38:40 +00:00
(( ++n ))
mkdir -p "${GLUON_PATCHESDIR}/$module"
echo "Updating: $(git log --format=%s -n 1 "$commit")"
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"
2013-12-28 16:17:02 +00:00
done
2013-12-28 14:31:11 +00:00
done