ports/109768: Update port databases/mysqlard add bash dependency
Pankov Pavel
pankov_p at mail.ru
Fri Mar 16 15:50:12 UTC 2007
The following reply was made to PR ports/109768; it has been noted by GNATS.
From: Pankov Pavel <pankov_p at mail.ru>
To: Gabor Kovesdan <gabor at FreeBSD.org>
Cc: bug-followup at FreeBSD.org
Subject: Re: ports/109768: Update port databases/mysqlard add bash dependency
Date: Fri, 16 Mar 2007 18:14:14 +0300
This is a multi-part message in MIME format.
--------------040909050302080702080906
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Gabor Kovesdan wrote:
> Hello Pankov,
>
> have you thought of patching the provided scripts to use /bin/sh? What
> do you think, will they work or do they require bash at all? Maybe,
> could you test them?
Hello!
Yes it perfectly works with /bin/sh after a small patch. Here is the
full patch which removes bash dependencies from mysqlard (attached).
--------------040909050302080702080906
Content-Type: text/plain;
name="mysqlard-bash2sh.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mysqlard-bash2sh.patch"
Index: ports/databases/mysqlard/files/mysqlard.sh.in
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/mysqlard.sh.in,v
retrieving revision 1.1
diff -u -r1.1 mysqlard.sh.in
--- ports/databases/mysqlard/files/mysqlard.sh.in 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/mysqlard.sh.in 16 Mar 2007 15:07:04 -0000
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/sh
#
# $Id: mysqlard.server.sh 40 2006-01-20 20:26:11Z dewitge $
#
@@ -16,7 +16,7 @@
. %%RC_SUBR%%
# Source the config script
-if [[ "$datadir" == "" ]] ; then
+if [ -z "$datadir" ] ; then
echo Loading defaultsettings
. %%PREFIX%%/etc/mysqlard.cnf
fi
@@ -44,11 +44,11 @@
slavefile=${slavefile:="${datadir}/slave.rrd"}
slaveopt=
-if [[ "$slave" != "" ]]; then
+if [ -n "$slave" ]; then
slaveopt=-L
fi
-if [[ "$MYSQLHOST" != "" ]] ; then
+if [ -n "$MYSQLHOST" ] ; then
MYSQLHOST=--host=$MYSQLHOST
fi
@@ -63,7 +63,7 @@
}
archives () {
arch=$(($1 / $2))
- if [[ $(($2 * ${arch} * $3)) -lt $4 ]]
+ if [ $(($2 * ${arch} * $3)) -lt $4 ]
then
arch=$((${arch} + 1))
fi
Index: ports/databases/mysqlard/files/patch-aa
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-aa,v
retrieving revision 1.1
diff -u -r1.1 patch-aa
--- ports/databases/mysqlard/files/patch-aa 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-aa 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlard.server.sh Tue Aug 1 11:11:29 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
#
# $Id: mysqlard.server.sh 40 2006-01-20 20:26:11Z dewitge $
#
Index: ports/databases/mysqlard/files/patch-ab
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-ab,v
retrieving revision 1.1
diff -u -r1.1 patch-ab
--- ports/databases/mysqlard/files/patch-ab 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-ab 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlar.monthly.sh Tue Aug 1 11:10:54 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
#
# $Id: mysqlar.monthly.sh 35 2004-03-10 15:48:41Z dewitge $
#
Index: ports/databases/mysqlard/files/patch-ac
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-ac,v
retrieving revision 1.1
diff -u -r1.1 patch-ac
--- ports/databases/mysqlard/files/patch-ac 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-ac 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlar.weekly.sh Tue Aug 1 11:11:09 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
#
# $Id: mysqlar.weekly.sh 35 2004-03-10 15:48:41Z dewitge $
#
Index: ports/databases/mysqlard/files/patch-ad
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-ad,v
retrieving revision 1.1
diff -u -r1.1 patch-ad
--- ports/databases/mysqlard/files/patch-ad 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-ad 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlard.cnf.sh Tue Aug 1 11:11:22 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
# $Id: mysqlard.cnf.sh 40 2006-01-20 20:26:11Z dewitge $
#
# MySQL Activity Report
Index: ports/databases/mysqlard/files/patch-ae
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-ae,v
retrieving revision 1.1
diff -u -r1.1 patch-ae
--- ports/databases/mysqlard/files/patch-ae 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-ae 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlar.daily.sh Tue Aug 1 11:10:47 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
#
# $Id: mysqlar.daily.sh 35 2004-03-10 15:48:41Z dewitge $
#
Index: ports/databases/mysqlard/files/patch-ag
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/patch-ag,v
retrieving revision 1.1
diff -u -r1.1 patch-ag
--- ports/databases/mysqlard/files/patch-ag 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/patch-ag 16 Mar 2007 15:07:04 -0000
@@ -2,7 +2,7 @@
+++ src/mysqlar_graph.sh Tue Aug 1 12:53:48 2006
@@ -1,4 +1,4 @@
-#!/bin/bash
-+#!/usr/local/bin/bash
++#!/bin/sh
#
# $Id: mysqlar_graph.sh 40 2006-01-20 20:26:11Z dewitge $
#
Index: ports/databases/mysqlard/files/pkg-message.in
===================================================================
RCS file: /home/ncvs/ports/databases/mysqlard/files/pkg-message.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-message.in
--- ports/databases/mysqlard/files/pkg-message.in 4 Oct 2006 20:00:40 -0000 1.1
+++ ports/databases/mysqlard/files/pkg-message.in 16 Mar 2007 15:07:04 -0000
@@ -8,7 +8,7 @@
2) Add the mysqlard crontab to root's crontab:
-*/5 * * * * hourly=1 daily=1 weekly=1 monthly=1 \
+*/5 * * * * /usr/bin/env hourly=1 daily=1 weekly=1 monthly=1 \
%%PREFIX%%/bin/mysqlar_graph > /dev/null
3) Add a line like this to your apache's httpd.conf:
--------------040909050302080702080906--
More information about the freebsd-ports-bugs
mailing list