Skip to content

Commit b5cabd2

Browse files
committed
install: Improve and simplify logging for patch failures.
1 parent 779a5c7 commit b5cabd2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

phreaknet.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,7 @@ git_patch() {
14691469
wget -q "https://raw.githubusercontent.com/InterLinked1/phreakscript/master/patches/$1" -O /tmp/$1 --no-cache
14701470
git apply "/tmp/$1"
14711471
if [ $? -ne 0 ]; then
1472-
echoerr "Failed to apply git patch... this should be reported..."
1473-
exit 2
1472+
die "Failed to apply git patch $1... this should be reported..."
14741473
fi
14751474
rm "/tmp/$1"
14761475
}
@@ -1517,10 +1516,12 @@ asterisk_pr() {
15171516
git_custom_patch() {
15181517
printf "Applying git patch: %s\n" "$1"
15191518
wget -q "$1" -O /tmp/tmp_git_patch.diff --no-cache
1519+
if [ ! -f /tmp/tmp_git_patch.diff ]; then
1520+
die "Failed to download patch $1"
1521+
fi
15201522
git apply "/tmp/tmp_git_patch.diff"
15211523
if [ $? -ne 0 ]; then
1522-
echoerr "Failed to apply git patch... this should be reported..."
1523-
exit 2
1524+
die "Failed to apply git patch $1... this should be reported..."
15241525
fi
15251526
rm "/tmp/tmp_git_patch.diff"
15261527
}
@@ -1884,8 +1885,6 @@ install_dahdi() {
18841885
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/64.diff" # PR 64: More struct device to const struct device
18851886
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/66.diff" # PR 66: Add braces around empty if body
18861887
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/69.diff" # PR 69: DEFINE_SEMAPHORE for RHEL
1887-
1888-
# Not yet merged
18891888
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/32.patch" # PR 32: xpp: Fix 32-bit builds
18901889

18911890
# Fix or skip compilation of the XPP driver for 32-bit

0 commit comments

Comments
 (0)