- fix unportable code in scripts;

"echo -e" -> "printf"
"exit -1" -> "exit 255"

- some of the patches had hand-rolled chunks to replace /bin/bash
with /bin/sh near a CVS keyword; remove these and replace with a
pre-configure target making it easier to update-patches

- change sample config to disable hardcoded escape sequences for
colours by default

- bump PKGNAME-main
This commit is contained in:
sthen 2009-09-12 09:42:04 +00:00
parent ff5050bbf0
commit ee595d2ae5
6 changed files with 135 additions and 27 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2009/08/15 08:50:21 sthen Exp $
# $OpenBSD: Makefile,v 1.3 2009/09/12 09:42:04 sthen Exp $
COMMENT-main = mature and flexible open source SIP server
@ -6,7 +6,7 @@ SHARED_ONLY = Yes
VERSION = 1.5.2
DISTNAME = kamailio-${VERSION}-tls_src
PKGNAME-main = kamailio-${VERSION}
PKGNAME-main = kamailio-${VERSION}p0
PKGNAME-mysql = kamailio-mysql-${VERSION}
PKGNAME-postgresql = kamailio-postgresql-${VERSION}
#PKGNAME-radius = kamailio-radius-${VERSION} TODO
@ -135,4 +135,8 @@ FULLPKGNAME$i ?= kamailio$i-${VERSION}
RUN_DEPENDS$i += :kamailio-${VERSION}:telephony/kamailio
.endfor
pre-configure:
@perl -pi -e '$$. == 1 && s,#!/bin/bash,#!/bin/sh,;' \
-e 's,exit -1,exit 255,' ${WRKSRC}/scripts/kam*
.include <bsd.port.mk>

View File

@ -1,14 +1,16 @@
$OpenBSD: patch-scripts_kamctl,v 1.1.1.1 2009/06/04 13:44:09 sthen Exp $
# N.B. Hand-edited to avoid CVS keywords.
--- scripts/kamctl.orig Wed May 13 21:34:58 2009
+++ scripts/kamctl Wed May 13 21:36:31 2009
@@ -1,2 +1,2 @@
-#!/usr/local/bin/bash
+#!/bin/sh
#
@@ -1654,7 +1654,7 @@ openser_stop() {
$OpenBSD: patch-scripts_kamctl,v 1.2 2009/09/12 09:42:04 sthen Exp $
--- scripts/kamctl.orig Tue Jul 14 15:48:56 2009
+++ scripts/kamctl Sat Sep 12 09:04:33 2009
@@ -56,7 +56,7 @@ fi
if [ -f "$MYLIBDIR/kamctl.base" ]; then
. "$MYLIBDIR/kamctl.base"
else
- echo -e "Cannot load core functions '$MYLIBDIR/kamctl.base' - exiting ...\n"
+ printf "Cannot load core functions '$MYLIBDIR/kamctl.base' - exiting ...\n"
exit -1
fi
@@ -1795,7 +1795,7 @@ openser_stop() {
options_ping() {
myhost=`get_my_host`
require_ctlengine

View File

@ -0,0 +1,48 @@
$OpenBSD: patch-scripts_kamctl_base,v 1.1 2009/09/12 09:42:04 sthen Exp $
--- scripts/kamctl.base.orig Sat Sep 12 09:04:42 2009
+++ scripts/kamctl.base Sat Sep 12 09:05:05 2009
@@ -522,7 +522,7 @@ USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_htable"
mdbg() {
if [ "0$VERBOSE" -ne 0 ] ; then
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e "\033[1m$1\033[0m"
+ printf "\033[1m$1\033[0m\n"
else
echo "$1"
fi
@@ -531,7 +531,7 @@ mdbg() {
mwarn() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;32m'"\033[1mWARNING: $1\033[0m"
+ printf '\e[37;32m'"\033[1mWARNING: $1\033[0m\n"
else
echo "** WARNING: $1"
fi
@@ -539,7 +539,7 @@ mwarn() {
minfo() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;33m'"\033[1mINFO: $1\033[0m"
+ printf '\e[37;33m'"\033[1mINFO: $1\033[0m\n"
else
echo "** INFO: $1"
fi
@@ -547,7 +547,7 @@ minfo() {
mecho() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e "\033[1m$1\033[0m"
+ printf "\033[1m$1\033[0m\n"
else
echo "$1"
fi
@@ -555,7 +555,7 @@ mecho() {
merr() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;31m'"\033[1mERROR: $1\033[0m"
+ printf '\e[37;31m'"\033[1mERROR: $1\033[0m\n"
else
echo "** ERROR: $1"
fi

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-scripts_kamctlrc,v 1.1.1.1 2009/06/04 13:44:09 sthen Exp $
--- scripts/kamctlrc.orig Thu Oct 23 12:04:49 2008
+++ scripts/kamctlrc Mon Nov 3 20:15:24 2008
@@ -135,7 +135,7 @@
$OpenBSD: patch-scripts_kamctlrc,v 1.2 2009/09/12 09:42:04 sthen Exp $
--- scripts/kamctlrc.orig Tue Jul 14 15:48:56 2009
+++ scripts/kamctlrc Fri Sep 11 23:39:57 2009
@@ -135,8 +135,12 @@
## OPENSER START Options
## PID file path - default is: /var/run/kamailio.pid
@ -10,3 +10,8 @@ $OpenBSD: patch-scripts_kamctlrc,v 1.1.1.1 2009/06/04 13:44:09 sthen Exp $
## Extra start options - default is: not set
# example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=
+
+# Disable colour highlighting at the terminal
+NOHLPRINT=1
+

View File

@ -1,10 +1,11 @@
$OpenBSD: patch-scripts_kamdbctl,v 1.1.1.1 2009/06/04 13:44:09 sthen Exp $
# N.B. Hand-edited to avoid CVS keywords.
--- scripts/kamdbctl.orig Wed May 13 21:38:24 2009
+++ scripts/kamdbctl Wed May 13 21:38:29 2009
@@ -1,2 +1,2 @@
-#!/usr/local/bin/bash
+#!/bin/sh
#
$OpenBSD: patch-scripts_kamdbctl,v 1.2 2009/09/12 09:42:04 sthen Exp $
--- scripts/kamdbctl.orig Sat Sep 12 09:05:19 2009
+++ scripts/kamdbctl Sat Sep 12 09:05:23 2009
@@ -51,7 +51,7 @@ fi
if [ -f "$MYLIBDIR/kamdbctl.base" ]; then
. "$MYLIBDIR/kamdbctl.base"
else
- echo -e "Cannot load core functions '$MYLIBDIR/kamdbctl.base' - exiting ...\n"
+ printf "Cannot load core functions '$MYLIBDIR/kamdbctl.base' - exiting ...\n"
exit -1
fi

View File

@ -0,0 +1,48 @@
$OpenBSD: patch-scripts_kamdbctl_base,v 1.1 2009/09/12 09:42:04 sthen Exp $
--- scripts/kamdbctl.base.orig Fri Sep 11 23:40:47 2009
+++ scripts/kamdbctl.base Fri Sep 11 23:42:25 2009
@@ -134,7 +134,7 @@ credentials()
mdbg() {
if [ "0$VERBOSE" -ne 0 ] ; then
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e "\033[1m$1\033[0m"
+ printf "\033[1m$1\033[0m\n"
else
echo "$1"
fi
@@ -143,7 +143,7 @@ mdbg() {
mwarn() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;32m'"\033[1mWARNING: $1\033[0m"
+ printf '\e[37;32m'"\033[1mWARNING: $1\033[0m\n"
else
echo "** WARNING: $1"
fi
@@ -151,7 +151,7 @@ mwarn() {
minfo() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;33m'"\033[1mINFO: $1\033[0m"
+ printf '\e[37;33m'"\033[1mINFO: $1\033[0m\n"
else
echo "** INFO: $1"
fi
@@ -159,7 +159,7 @@ minfo() {
mecho() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e "\033[1m$1\033[0m"
+ printf "\033[1m$1\033[0m\n"
else
echo "$1"
fi
@@ -167,7 +167,7 @@ mecho() {
merr() {
if [ -t 1 -a -z "$NOHLPRINT" ] ; then
- echo -e '\E[37;31m'"\033[1mERROR: $1\033[0m"
+ printf '\e[37;31m'"\033[1mERROR: $1\033[0m\n"
else
echo "** ERROR: $1"
fi