bacula tweak: fix path to database binaries in baculabackupreport script,
drop 2/3 awk->gawk conversions that aren't needed, more info in patch comment regarding the remaining one that needs gawk
This commit is contained in:
parent
53417b9757
commit
a494230dfd
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.148 2020/06/11 14:38:51 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.149 2020/06/11 14:55:07 sthen Exp $
|
||||
|
||||
# XXX building this port while a version is already installed on the
|
||||
# system will lead to unexpected hidden dependencies!!!
|
||||
@ -9,6 +9,7 @@ COMMENT-bat= network backup solution (gui-client)
|
||||
COMMENT-mysql= Bacula libbaccats support for MySQL
|
||||
COMMENT-pgsql= Bacula libbaccats support for PostgreSQL
|
||||
COMMENT-sqlite3= Bacula libbaccats support for SQLite3
|
||||
REVISION-server= 0
|
||||
|
||||
V= 9.6.4
|
||||
DISTNAME= bacula-$V
|
||||
@ -162,8 +163,8 @@ CONFIGURE_ARGS += --with-postgresql
|
||||
.endif
|
||||
|
||||
pre-configure:
|
||||
${SUBST_CMD} ${WRKSRC}/manpages/bat.1 \
|
||||
${WRKSRC}/src/qt-console/main.cpp
|
||||
cd ${WRKSRC}; ${SUBST_CMD} manpages/bat.1 \
|
||||
src/qt-console/main.cpp scripts/baculabackupreport.in
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/bacula
|
||||
|
@ -1,10 +1,28 @@
|
||||
$OpenBSD: patch-scripts_baculabackupreport_in,v 1.1 2019/07/26 13:41:19 robert Exp $
|
||||
$OpenBSD: patch-scripts_baculabackupreport_in,v 1.2 2020/06/11 14:55:07 sthen Exp $
|
||||
|
||||
without GNU awk,
|
||||
|
||||
awk: weird printf conversion %"> <r
|
||||
input record number 5, file
|
||||
source line number 271
|
||||
|
||||
awk: not enough args in printf(<br> <hr align="left" width="25%"> <table width="25%"> <tr><td><b>Total Jobs</b></td><td align="center"><b>:</b></td> <td align="right"><b>%'15d</b></td></tr> <tr><td><b>Total Files</b></td><td align="center"><b>:</b></td> <td align="right"><b>%'15d</b></td></tr> <tr><td><b>Total Bytes</b></td><td align="center"><b>:</b></td> <td align="right"><b>%'15.2f GB</b></td></tr> </table> <hr align="left" width="25%">)
|
||||
input record number 5, file
|
||||
source line number 271
|
||||
|
||||
This script requires GNU awk to produce proper output.
|
||||
|
||||
Index: scripts/baculabackupreport.in
|
||||
--- scripts/baculabackupreport.in.orig
|
||||
+++ scripts/baculabackupreport.in
|
||||
@@ -53,7 +53,7 @@ bcconfig="@sysconfdir@/bconsole.conf"
|
||||
dbtype="@DEFAULT_DB_TYPE@" # Supported options are pgsql/postgresql, mysql, mariadb
|
||||
db="@db_name@"
|
||||
dbuser="@db_user@"
|
||||
-dbbindir="/usr/bin"
|
||||
+dbbindir="${LOCALBASE}/bin"
|
||||
# dbpass="-p@db_password@" # Uncomment and set db password if one is used
|
||||
|
||||
# Formatting variables
|
||||
@@ -179,7 +179,7 @@ if [ -z "${queryresult}" ]; then
|
||||
IFS=" "
|
||||
msg=$(echo ${queryresult} | \
|
||||
@ -14,30 +32,3 @@ Index: scripts/baculabackupreport.in
|
||||
-v html="${html}" \
|
||||
-v boldstatus="${boldstatus}" \
|
||||
-v colorstatusbg="${colorstatusbg}" \
|
||||
@@ -550,7 +550,7 @@ if [ ${emailsummaries} == "yes" ]; then
|
||||
# a summary in the DB until the job has terminated
|
||||
# -------------------------------------------------
|
||||
alljobids=$(echo "${queryresult}" \
|
||||
- | awk '{ if ($7 != "R") printf("%s ", $1) }')
|
||||
+ | gawk '{ if ($7 != "R") printf("%s ", $1) }')
|
||||
|
||||
|
||||
# If no jobids were returned, skip creating
|
||||
@@ -595,7 +595,7 @@ if [ ${emailbadlogs} == "yes" ]; then
|
||||
# JobErrors != 0 from the query results
|
||||
# --------------------------------------
|
||||
badjobids=$(echo "${queryresult}" \
|
||||
- | awk '{ if ($9 ~ /[ABDEIef]/ || ($9 == "T" && $13 != 0)) printf("%s ", $1) }')
|
||||
+ | gawk '{ if ($9 ~ /[ABDEIef]/ || ($9 == "T" && $13 != 0)) printf("%s ", $1) }')
|
||||
|
||||
|
||||
# If no jobids were returned, skip creating
|
||||
@@ -671,7 +671,7 @@ ${msg}"
|
||||
fi
|
||||
|
||||
fi # If there were zero results returned from the
|
||||
- # SQL the query, we skip the entire awk script,
|
||||
+ # SQL the query, we skip the entire gawk script,
|
||||
# and a lot of other bash stuff that generates
|
||||
# the email body and we end up here
|
||||
# -------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user