#!/bin/bash # ./applypatchesl10n.sh "/e/builds/beta-253/253-gitlab/l10n-release/*" cd /e/builds/beta-253/l10n-release export IFS= # git checkout 2_53_9_1_final git checkout 2_53_10_beta_01 # list directories for dir in $1 do dir=${dir%*/} l10n=${dir##*/} # remove the trailing "/" echo $dir echo $l10n series=$dir/patches/series echo $series while read -r line || [[ -n "$line" ]]; do echo "apply patch: $line" patchfile=$dir/patches/$(echo $line) if [[ "$line" == PPPP* ]] || [[ "$line" == WIP* ]] || [[ "$line" != *-25310.patch ]] ; then echo "patch $line skipped" else if [ -f "$patchfile" ]; then echo "$patchfile exist" #git apply --directory=$l10n --stat "$patchfile" #git apply --directory=$l10n --check "$patchfile" # git apply --index --whitespace=nowarn "$patchfile" git am --directory=$l10n --patch-format=hg --whitespace=nowarn < "$patchfile" if [ $? -eq 0 ] then echo "ok" else echo "error" git am --abort exit 1 fi fi fi done < "$series" done cd ..