Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit 9557c95

Browse files
committed
proc/40-patch: add rpatch/rdiff routine; add return code to error message
1 parent 2adb196 commit 9557c95

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

proc/40-patch.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
abrequire arch
55

66
PATCHFLAGS="-Np1 -t"
7+
RPATCHFLAGS="-Rp1 -t"
78

89
if [ ! -f .patch ]
910
then
@@ -14,19 +15,27 @@ then
1415
then
1516
for i in $(grep -v '^#' autobuild/patches/series); do
1617
abinfo "Applying patch $i ..."
17-
patch $PATCHFLAGS -i "autobuild/patches/$i" || abdie "Applying patch $i failed"
18+
patch $PATCHFLAGS -i "autobuild/patches/$i" || abdie "Applying patch $i failed: $?."
1819
done
1920
touch .patch
2021
elif [ -d autobuild/patches ]
2122
then
2223
for i in autobuild/patches/*.{patch,diff}; do
2324
abinfo "Applying patch $i ..."
24-
patch $PATCHFLAGS -i "$i" || abdie "Applying patch $i failed"
25+
patch $PATCHFLAGS -i "$i" || abdie "Applying patch $i failed: $?."
2526
done
2627
for i in autobuild/patches/*.{patch,diff}."${CROSS:-$ARCH}"; do
2728
abinfo "Applying patch $i (for ${CROSS:-$ARCH}) ..."
2829
patch $PATCHFLAGS -i "$i" || abdie "Applying patch $i for ${CROSS:-$ARCH} failed: $?."
2930
done
30-
touch .patch
31+
for i in autobuild/patches/*.r{patch,diff}; do
32+
abinfo "Reverting patch $i ..."
33+
patch $RPATCHFLAGS -i "$i" || abdie "Reverting patch $i failed: $?."
34+
done
35+
for i in autobuild/patches/*.r{patch,diff}."${CROSS:-$ARCH}"; do
36+
abinfo "Applying patch $i (for ${CROSS:-$ARCH}) ..."
37+
patch $RPATCHFLAGS -i "$i" || abdie "Reverting patch $i for ${CROSS:-$ARCH} failed: $?."
38+
done
39+
touch "$SRCDIR"/.patch
3140
fi
3241
fi

0 commit comments

Comments
 (0)