haproxy/haproxy-1.5.8-fix-bashisms.patch

77 lines
2.8 KiB
Diff

diff -Ndur haproxy-1.5.8/examples/build.cfg haproxy-1.5.8-fix-bashisms/examples/build.cfg
--- haproxy-1.5.8/examples/build.cfg 2014-10-31 11:06:53.000000000 +0200
+++ haproxy-1.5.8-fix-bashisms/examples/build.cfg 2014-11-17 04:09:42.408078486 +0200
@@ -5,12 +5,12 @@
PATCH_LIST=
FILE_LIST=
-function do_compile_only {
+do_compile_only() {
$FLXMAKE CPU_OPTS="-march=$arch -mcpu=$cpu -Os -mpreferred-stack-boundary=2 -momit-leaf-frame-pointer -malign-jumps=0" \
TARGET=linux24
}
-function do_prepack {
+do_prepack() {
mkdir -p $ROOTDIR/sbin/init.d ; cp examples/init.haproxy.flx0 $ROOTDIR/sbin/init.d/haproxy
mkdir -p $ROOTDIR/usr/sbin ; cp haproxy $ROOTDIR/usr/sbin
mkdir -p $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/haproxy/
diff -Ndur haproxy-1.5.8/examples/haproxy-1.1.21-flx.1.pkg haproxy-1.5.8-fix-bashisms/examples/haproxy-1.1.21-flx.1.pkg
--- haproxy-1.5.8/examples/haproxy-1.1.21-flx.1.pkg 2014-10-31 11:06:53.000000000 +0200
+++ haproxy-1.5.8-fix-bashisms/examples/haproxy-1.1.21-flx.1.pkg 2014-11-17 04:09:28.396079434 +0200
@@ -1,10 +1,10 @@
#!/bin/sh
-function do_compile {
+do_compile() {
$FLXMAKE COPTS="-march=$arch -mcpu=$cpu -Os -mpreferred-stack-boundary=2 -momit-leaf-frame-pointer -malign-jumps=0 -DNETFILTER -DTRANSPARENT"
}
-function do_prepack {
+do_prepack() {
mkdir -p $ROOTDIR/sbin/init.d ; cp init.d/haproxy $ROOTDIR/sbin/init.d
mkdir -p $ROOTDIR/usr/sbin ; cp haproxy $ROOTDIR/usr/sbin
mkdir -p $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc
diff -Ndur haproxy-1.5.8/examples/haproxy.init haproxy-1.5.8-fix-bashisms/examples/haproxy.init
--- haproxy-1.5.8/examples/haproxy.init 2014-10-31 11:06:53.000000000 +0200
+++ haproxy-1.5.8-fix-bashisms/examples/haproxy.init 2014-11-17 04:10:05.127076949 +0200
@@ -116,7 +116,7 @@
check
;;
*)
- echo $"Usage: $BASENAME {start|stop|restart|reload|condrestart|status|check}"
+ echo "Usage: $BASENAME {start|stop|restart|reload|condrestart|status|check}"
exit 1
esac
diff -Ndur haproxy-1.5.8/examples/init.haproxy haproxy-1.5.8-fix-bashisms/examples/init.haproxy
--- haproxy-1.5.8/examples/init.haproxy 2014-10-31 11:06:53.000000000 +0200
+++ haproxy-1.5.8-fix-bashisms/examples/init.haproxy 2014-11-17 04:10:58.897073312 +0200
@@ -19,7 +19,7 @@
maintfd=0
fi
-maxfd=$[$maxconn*2 + $maintfd]
+maxfd=$(($maxconn * 2 + $maintfd))
if [ $maxfd -lt 100 ]; then
maxfd=100;
fi
@@ -31,7 +31,7 @@
# ulimit -c unlimited
# soft stop
-function do_stop {
+do_stop() {
pids=`pidof -o $$ -- $PNAME`
if [ ! -z "$pids" ]; then
echo "Asking $PNAME to terminate gracefully..."
@@ -41,7 +41,7 @@
}
# dump status
-function do_status {
+do_status() {
pids=`pidof -o $$ -- $PNAME`
if [ ! -z "$pids" ]; then
echo "Dumping $PNAME status in logs."