[pkg-bacula-commits] [bacula] 01/01: Added patches to modify the baculabackupreport script to use sensible defaults

Carsten Leonhardt leo at moszumanska.debian.org
Mon Sep 4 17:32:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to branch master
in repository bacula.

commit 3a4183573fde04d9beae517c42950402032a8230
Author: Carsten Leonhardt <leo at debian.org>
Date:   Mon Sep 4 19:31:10 2017 +0200

    Added patches to modify the baculabackupreport script to use sensible
    defaults
    
    Still missing:
    
     - Automatic handling of the database password
     - modifying the debian placeholders in postinst
---
 debian/TODO                                        |  5 ++
 debian/changelog                                   |  4 +-
 .../debian-fix-baculabackupreport-cmd-paths.patch  | 16 ------
 .../debian-fix-baculabackupreport-defaults.patch   | 11 ++++
 debian/patches/series                              |  3 +-
 .../upstream-fix-baculabackupreport-defaults.patch | 59 ++++++++++++++++++++++
 6 files changed, 80 insertions(+), 18 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 0df9ac0..b9af43e 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -3,6 +3,11 @@ Before next upload:
  * maybe wait for input from upstream about
    http://bugs.bacula.org/view.php?id=2305
    http://bugs.bacula.org/view.php?id=2306
+ * finish work on baculabackupreport script:
+   Still missing:
+     - Automatic handling of the database password
+     - modifying the debian placeholders in postinst
+
 
 Very High:
 
diff --git a/debian/changelog b/debian/changelog
index 4e94746..3b52887 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,9 @@ bacula (9.0.3+dfsg-2) unstable; urgency=low
   * Added notice about discontinued sqlite3 support also to the package
     description of bacula-common-sqlite3
   * Another fix to upstream-fix-sqlite-update.patch, thanks to Martin on
-    upstream's bug tracker for pointing it out.
+    upstream's bug tracker for pointing it out
+  * Added patches to modify the baculabackupreport script to use sensible
+    defaults
 
  --
 
diff --git a/debian/patches/debian-fix-baculabackupreport-cmd-paths.patch b/debian/patches/debian-fix-baculabackupreport-cmd-paths.patch
deleted file mode 100644
index 9c36de8..0000000
--- a/debian/patches/debian-fix-baculabackupreport-cmd-paths.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Change paths for bconsole and its config file to match Debian
-
---- a/scripts/baculabackupreport.in
-+++ b/scripts/baculabackupreport.in
-@@ -44,9 +44,9 @@
- # ----------------
- server="@hostname@"
- admin="@job_email@"
--bcbin="/opt/bacula/bin/bconsole"
-+bcbin="/usr/sbin/bconsole"
- sendmail="/usr/sbin/sendmail"
--bcconfig="/opt/bacula/etc/bconsole.conf"
-+bcconfig="/etc/bacula/bconsole.conf"
- 
- # Database variables
- # ------------------
diff --git a/debian/patches/debian-fix-baculabackupreport-defaults.patch b/debian/patches/debian-fix-baculabackupreport-defaults.patch
new file mode 100644
index 0000000..c57c3c4
--- /dev/null
+++ b/debian/patches/debian-fix-baculabackupreport-defaults.patch
@@ -0,0 +1,11 @@
+--- a/scripts/baculabackupreport.in
++++ b/scripts/baculabackupreport.in
+@@ -42,7 +42,7 @@
+ 
+ # System variables
+ # ----------------
+-server="@hostname@"
++server="@debian_hostname@"
+ admin="@job_email@"
+ bcbin="@sbindir@/bconsole"
+ sendmail="/usr/sbin/sendmail"
diff --git a/debian/patches/series b/debian/patches/series
index e83bd48..a282c6e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,4 +11,5 @@ non-forking-systemd-units.patch
 upstream-bring-back-tmpfiles-configuration.patch
 upstream-fix-sqlite-update.patch
 upstream-fix-sqlite-db-creation.patch
-debian-fix-baculabackupreport-cmd-paths.patch
+upstream-fix-baculabackupreport-defaults.patch
+debian-fix-baculabackupreport-defaults.patch
diff --git a/debian/patches/upstream-fix-baculabackupreport-defaults.patch b/debian/patches/upstream-fix-baculabackupreport-defaults.patch
new file mode 100644
index 0000000..698ada2
--- /dev/null
+++ b/debian/patches/upstream-fix-baculabackupreport-defaults.patch
@@ -0,0 +1,59 @@
+Description: Let the configure script fill in defaults for the variables
+Last update: 2017-09-04
+
+--- a/scripts/baculabackupreport.in
++++ b/scripts/baculabackupreport.in
+@@ -44,17 +44,16 @@
+ # ----------------
+ server="@hostname@"
+ admin="@job_email@"
+-bcbin="/opt/bacula/bin/bconsole"
++bcbin="@sbindir@/bconsole"
+ sendmail="/usr/sbin/sendmail"
+-bcconfig="/opt/bacula/etc/bconsole.conf"
++bcconfig="@sysconfdir@/bconsole.conf"
+ 
+ # Database variables
+ # ------------------
+-dbtype="pgsql"                          # Supported options are pgsql, mysql, mariadb
+-db="bacula"
+-dbuser="bacula"
+-dbbin="/usr/bin/psql"
+-# dbpass="-pPassword"   # Uncomment and set db password if one is used
++dbtype="@DEFAULT_DB_TYPE@"                          # Supported options are pgsql/postgresql, mysql, mariadb
++db="@db_name@"
++dbuser="@db_user@"
++# dbpass="-p at db_password@"   # Uncomment and set db password if one is used
+ 
+ # Formatting variables
+ # --------------------
+@@ -133,17 +132,17 @@
+                 FROM Job \
+                 WHERE (RealEndTime >= DATE_ADD(NOW(), INTERVAL -${hist} HOUR) OR JobStatus='R') \
+                 ORDER BY ${sortfield} ${sortorder};" \
+-                | ${dbbin} -u ${dbuser} ${dbpass} ${db} \
++                | @MYSQL_BINDIR@/mysql -u ${dbuser} ${dbpass} ${db} \
+                 | sed '/^JobId/d' )
+                 ;;
+ 
+-        pgsql )
++        pgsql|postgresql )
+                 queryresult=$(echo "SELECT JobId, Name, StartTime, EndTime, Type, Level, JobStatus, JobFiles, JobBytes, \
+                 AGE(EndTime, StartTime) as RunTime, JobErrors \
+                 FROM Job \
+                 WHERE (RealEndTime >= CURRENT_TIMESTAMP(2) - cast('${hist} HOUR' as INTERVAL) OR JobStatus='R') \
+                 ORDER BY ${sortfield} ${sortorder};" \
+-                | ${dbbin} -U ${dbuser} ${dbpass} ${db} -0t \
++                | @POSTGRESQL_BINDIR@/psql -U ${dbuser} ${dbpass} ${db} -0t \
+                 | sed -e 's/|//g' -e '/^$/d' )
+                 ;;
+ 
+@@ -153,7 +152,7 @@
+                 FROM Job \
+                 WHERE (RealEndTime >= DATE_ADD(NOW(), INTERVAL -${hist} HOUR) OR JobStatus='R') \
+                 ORDER BY ${sortfield} ${sortorder};" \
+-                | ${dbbin} -u ${dbuser} -p${dbpass} ${db} -s -N )
++                | @MYSQL_BINDIR@/mysql -u ${dbuser} -p${dbpass} ${db} -s -N )
+                 ;;
+ 
+         * )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list