gluon/scripts/update-patches.sh
Petr Štetiar 9dc1ac7f58
build: replace hardcoded paths with overridable variables
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-04-22 22:00:45 +02:00

27 lines
631 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
let n=n+1
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