diff options
Diffstat (limited to 'patch.sh')
-rwxr-xr-x | patch.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patch.sh b/patch.sh new file mode 100755 index 0000000..fc1a6a3 --- /dev/null +++ b/patch.sh @@ -0,0 +1,19 @@ +#! /bin/bash + +cd $1 + +for pch in ../*.patch; do + printf "Applying patch %s...\n" "$pch" + patch -Np1 < "$pch" | sed 's/^/--> /g' + if [ "$?" == "0" ]; then + printf "[OK] Applying patch %s [OK]\n" "$pch" + else + printf "[ERR!!!] Applying patch %s [ERR!!!]\n" "$pch" + if [ "$2" != "skip" ]; then + echo "assuming error is critical, aborting\n" + exit 1 + fi + fi + + touch ../patch.ok +done |