]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove last traces of @SQL_BINDIR@ and @DB_TYPE@
authorMarco van Wieringen <mvw@planets.elm.net>
Mon, 7 Nov 2011 19:01:49 +0000 (20:01 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:12 +0000 (14:50 +0200)
During the backend refactoring SQL_BINDIR and DB_TYPE were
replaced with backend specific variables as multiple backends
can be configured in one configure run. This should remove
the last traces of these variables from the active source.
The only pieces left with the old SQL_BINDIR are the unsupported
Windows director database creation scripts.

22 files changed:
bacula/autoconf/bacula-macros/db.m4
bacula/platforms/gentoo/bacula-init.in
bacula/platforms/suse/bacula-dir-suse-sqlite.patch
bacula/platforms/suse/bacula-dir.in
bacula/src/cats/create_sqlite3_database.in.patch
bacula/src/cats/make_catalog_backup.in.patch
bacula/src/cats/make_ingres_catalog_backup.in
bacula/src/cats/make_sqlite3_tables.in.patch
bacula/src/cats/restore_ingres_catalog_backup.in
bacula/src/cats/update_sqlite3_tables.in.patch
bacula/src/dird/bacula-dir.conf.in
bacula/updatedb/update_mysql_tables_10_to_11.in
bacula/updatedb/update_mysql_tables_11_to_12.in
bacula/updatedb/update_mysql_tables_9_to_10.in
bacula/updatedb/update_postgresql_tables_10_to_11.in
bacula/updatedb/update_postgresql_tables_11_to_12.in
bacula/updatedb/update_postgresql_tables_9_to_10.in
bacula/updatedb/update_sqlite3_tables_10_to_11.in
bacula/updatedb/update_sqlite3_tables_11_to_12.in
bacula/updatedb/update_sqlite3_tables_9_to_10.in
bacula/updatedb/update_sqlite_tables_10_to_11.in
bacula/updatedb/update_sqlite_tables_9_to_10.in

index 2678af593b78c82d3e7953a72e7eff1ba684f524..8ef51bbbcec8ca5e361d94084c82a5181091a1bc 100644 (file)
@@ -166,7 +166,7 @@ AC_HELP_STRING([--with-dbi-driver@<:@=DRIVER@:>@], [Suport for DBI driver. DRIVE
         "mysql")
            db_prog="mysql"
            if test -f /usr/local/mysql/bin/mysql; then
-              SQL_BINDIR=/usr/local/mysql/bin
+              MYSQL_BINDIR=/usr/local/mysql/bin
               if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
                  -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
                  MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
@@ -174,7 +174,7 @@ AC_HELP_STRING([--with-dbi-driver@<:@=DRIVER@:>@], [Suport for DBI driver. DRIVE
                  MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
               fi
            elif test -f /usr/bin/mysql; then
-              SQL_BINDIR=/usr/bin
+              MYSQL_BINDIR=/usr/bin
               if test -f /usr/lib64/mysql/libmysqlclient_r.a \
                   -o -f /usr/lib64/mysql/libmysqlclient_r.so; then  
                   MYSQL_LIBDIR=/usr/lib64/mysql
@@ -185,7 +185,7 @@ AC_HELP_STRING([--with-dbi-driver@<:@=DRIVER@:>@], [Suport for DBI driver. DRIVE
                   MYSQL_LIBDIR=/usr/lib
               fi
            elif test -f /usr/local/bin/mysql; then
-              SQL_BINDIR=/usr/local/bin
+              MYSQL_BINDIR=/usr/local/bin
               if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
                   -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then  
                   MYSQL_LIBDIR=/usr/local/lib64/mysql
@@ -196,7 +196,7 @@ AC_HELP_STRING([--with-dbi-driver@<:@=DRIVER@:>@], [Suport for DBI driver. DRIVE
                   MYSQL_LIBDIR=/usr/local/lib
               fi
            elif test -f $withval/bin/mysql; then
-              SQL_BINDIR=$withval/bin
+              MYSQL_BINDIR=$withval/bin
               if test -f $withval/lib64/mysql/libmysqlclient_r.a \
                   -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
                   MYSQL_LIBDIR=$withval/lib64/mysql
index b3ddaa1a8f0690b17f81165fb9b1b3064f44649a..0c78153f59cf1fb6436caf9bd15138158629a572 100755 (executable)
@@ -6,7 +6,7 @@
 
 depend() {
        need net
-       use @DB_TYPE@
+       use @DEFAULT_DB_TYPE@
 }
 
 opts="test"
index 8f5ce1f1cb9c736586e7c1a07d412c5ba8c63e69..f5b008602755a796288887c810d45a58b350eaa1 100644 (file)
@@ -4,8 +4,8 @@
  #
  ### BEGIN INIT INFO
  # Provides:                     bacula-dir
--# Required-Start:               $local_fs $network @DB_TYPE@
--# Required-Stop:                $local_fs $network @DB_TYPE@
+-# Required-Start:               $local_fs $network @DEFAULT_DB_TYPE@
+-# Required-Stop:                $local_fs $network @DEFAULT_DB_TYPE@
 +# Required-Start:               $local_fs $network
 +# Required-Stop:                $local_fs $network
  # Default-Start:                3 5
index 5402a0de16dc1d3a7666a43b61e5f1f00c6f1f9a..550b9ceff335102677a7294f24559234df38e9ee 100755 (executable)
@@ -13,8 +13,8 @@
 #
 ### BEGIN INIT INFO
 # Provides:                    bacula-dir
-# Required-Start:              $local_fs $network @DB_TYPE@
-# Required-Stop:               $local_fs $network @DB_TYPE@
+# Required-Start:              $local_fs $network @DEFAULT_DB_TYPE@
+# Required-Stop:               $local_fs $network @DEFAULT_DB_TYPE@
 # Default-Start:               3 5
 # Default-Stop:        0 1 2 6
 # Short-Description:   bacula director
index faa83e640d766da6a7f1a895937615f8e852c273..c82adc4a2f299e2ed758d7ae4c6e4e5e20d0f156 100644 (file)
@@ -4,8 +4,8 @@
  #
  # shell script to create Bacula SQLite tables
  
--bindir=@SQL_BINDIR@
+-bindir=@SQLITE_BINDIR@
 +bindir=/usr/lib/bacula/sqlite
  cd @working_dir@
- sqlite=@DB_TYPE@
  db_name=@db_name@
index 7279dc005b5e1bf49e4c6a77bdd08f2be6a5f802..08988b26a750a0a0eeae9f3f3fdd58804fc5f777 100644 (file)
@@ -1,20 +1,12 @@
 --- make_catalog_backup.in      2006-12-09 10:17:05.000000000 -0500
-+++ make_catalog_backup.in.fixed        2006-12-09 10:24:40.000000000 -0500
-@@ -16,7 +16,7 @@
- cd @working_dir@
- rm -f bacula.sql
- if test xsqlite = x@DB_TYPE@ ; then
--  echo ".dump" | ${BINDIR}/sqlite $1.db >$1.sql
-+  echo ".dump" | /usr/lib/bacula/sqlite/sqlite $1.db >$1.sql
- else
-   if test xmysql = x@DB_TYPE@ ; then
-     if test $# -gt 2; then
-@@ -33,7 +33,7 @@
-       fi
-       exec ${BINDIR}/pg_dump -c -U $2 $1 >$1.sql
-     else
--      echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql
-+      echo ".dump" | /usr/lib/bacula/sqlite/sqlite3 $1.db >$1.sql
-     fi
-   fi
- fi
+++ make_catalog_backup.in.fixed        2006-12-09 10:24:40.000000000 -0500
+@@ -56,8 +56,7 @@ rm -f $1.sql
+ case ${db_type} in
+   sqlite3)
+-    BINDIR=@SQLITE_BINDIR@
+-    echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql
++    echo ".dump" | /opt/bacula/sqlite/sqlite3 $1.db >$1.sql
+     ;;
+   mysql)
+     BINDIR=@MYSQL_BINDIR@
index 6bf784dca22325ead9e0163ceed6dd586d83ff19..bcd0ce10e7357283690f58250197d0ac717f5433 100755 (executable)
@@ -4,7 +4,7 @@
 # a base64 encoded tar of the content.
 #
 
-bindir=@SQL_BINDIR@
+bindir=@INGRES_BINDIR@
 PATH="$bindir:$PATH"
 db_name=${db_name:-@db_name@}
 db_user=${db_user:-@db_user@}
index 06b577b2bb2b6e559c81c3a1ca30ecf422aea090..f9a95082a170ad6912e1f3a09c2f505615b0cc9d 100644 (file)
@@ -4,8 +4,9 @@
  #
  # shell script to create Bacula SQLite tables
  
--bindir=@SQL_BINDIR@
+-bindir=@SQLITE_BINDIR@
 +bindir=/usr/lib/bacula/sqlite
  PATH="$bindir:$PATH"
  cd @working_dir@
- sqlite=@DB_TYPE@
+ db_name=@db_name@
+
index a12e101fd3d2eb83ec786ca956d21607f3a52d23..cc07732a086b381ca85d3c47c0b4f9f4f087adb9 100755 (executable)
@@ -4,7 +4,7 @@
 # a base64 encoded tar of the content.
 #
 
-bindir=@SQL_BINDIR@
+bindir=@INGRES_BINDIR@
 PATH="$bindir:$PATH"
 db_name=${db_name:-@db_name@}
 db_user=${db_user:-@db_user@}
index 5b2a36b8de9e04dbdcdcbd5f51c9a6c35386c005..252a0f3e66ea75505a6c514bf7a519d49986a085 100644 (file)
@@ -1,11 +1,11 @@
 --- ./update_sqlite3_tables.in 2010-01-25 02:56:28.000000000 -0500
 +++ ../../../bacula-5.0.0-fixed/src/cats/update_sqlite3_tables.in      2010-01-31 10:22:52.000000000 -0500
-@@ -11,7 +11,7 @@
- echo "this script may take several minutes to run."
+@@ -7,7 +7,7 @@ echo "This script will update a Bacula MySQL database from version 12 to 14"
+ echo " which is needed to convert from Bacula Community version 5.0.x to 5.2.x"
  echo " "
  
--bindir=@SQL_BINDIR@
+-bindir=@SQLITE_BINDIR@
 +bindir=/usr/lib/bacula/sqlite
  PATH="$bindir:$PATH"
  cd @working_dir@
sqlite=@DB_TYPE@
db_name=@db_name@
index 080d59a08a1183133160c7b43f1f212b8555284b..5793ea1ff52cee7a48de338e46f62bb96d21b6fb 100644 (file)
@@ -231,7 +231,7 @@ Storage {
 Catalog {
   Name = MyCatalog
 # Uncomment the following line if you want the dbi driver
-@uncomment_dbi@ dbdriver = "dbi:@DB_TYPE@"; dbaddress = 127.0.0.1; dbport = @db_port@
+@uncomment_dbi@ dbdriver = "dbi:@DEFAULT_DB_TYPE@"; dbaddress = 127.0.0.1; dbport = @db_port@
   dbname = "@db_name@"; dbuser = "@db_user@"; dbpassword = "@db_password@"
 }
 
index e78a13592c49a9369060577fee22ff11a2f365c5..ea4a85cad40a56511765edf2e7719970f5bfeeb1 100644 (file)
@@ -6,10 +6,11 @@ echo " "
 echo "This script will update a Bacula MySQL database from version 10 to 11"
 echo " which is needed to convert from Bacula version 2.0.x to 3.0.x or higher"
 echo " "
-bindir=@SQL_BINDIR@
-db_name=@db_name@
+bindir=@MYSQL_BINDIR@
+PATH="$bindir:$PATH"
+db_name=${db_name:-@db_name@}
 
-if $bindir/mysql $* -f <<END-OF-DATA
+if mysql $* -f <<END-OF-DATA
 USE ${db_name};
 
 -- Fix bad index on Media table
index ea2afb67bd24090a0c1802d95a02e5d0972459a3..32a07c0d5da4c2eaeb239632df7a028402035969 100644 (file)
@@ -6,9 +6,9 @@ echo " "
 echo "This script will update a Bacula MySQL database from version 11 to 12"
 echo " which is needed to convert from Bacula Community version 3.0.x to 5.0.x"
 echo " "
-bindir=@SQL_BINDIR@
+bindir=@MYSQL_BINDIR@
 PATH="$bindir:$PATH"
-db_name=@db_name@
+db_name=${db_name:-@db_name@}
 
 mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$
 DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
index ce2fd2a62e8827e67205b47fb4fac53653fc3567..37228199b90e8e1c448f7fe3209854f48ddebb87 100644 (file)
@@ -8,10 +8,11 @@ echo " which is needed to convert from Bacula version 1.38.x to 2.0.x or higher"
 echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
-bindir=@SQL_BINDIR@
-db_name=@db_name@
+bindir=@MYSQL_BINDIR@
+PATH="$bindir:$PATH"
+db_name=${db_name:-@db_name@}
 
-if $bindir/mysql $* -f <<END-OF-DATA
+if mysql $* -f <<END-OF-DATA
 USE ${db_name};
 
 DROP TABLE IF EXISTS MAC;
index 87381c29f26cc4cd42466460b1c7f05c5b61134c..f5df19f2ba1893f573b27f8aa527809a31a471d4 100644 (file)
@@ -6,11 +6,11 @@ echo " "
 echo "This script will update a Bacula PostgreSQL database from version 10 to 11"
 echo " which is needed to convert from Bacula version 2.0.0 to 3.0.x or higher"
 echo " "
-bindir=@SQL_BINDIR@
-db_name=@db_name@
-
-if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
+bindir=@POSTGRESQL_BINDIR@
+PATH="$bindir:$PATH"
+db_name=${db_name:-@db_name@}
 
+psql -f - -d ${db_name} $* <<END-OF-DATA
 -- The alter table operation can be faster with a big maintenance_work_mem
 -- Uncomment and adapt this value to your environment
 -- SET maintenance_work_mem = '1GB';
index 8cadf7abc432783fd62b634381f074a37186316f..e15d8171c7de5bba3100b36be292d1d168581bd6 100644 (file)
@@ -7,9 +7,9 @@ echo "This script will update a Bacula PostgreSQL database from version 11 to 12
 echo " which is needed to convert from Bacula Community version 3.0.x to 5.0.x"
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@POSTGRESQL_BINDIR@
 PATH="$bindir:$PATH"
-db_name=@db_name@
+db_name=${db_name:-@db_name@}
 
 DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version" $*`
 if [ $DBVERSION != 11 ] ; then
index 97ecee2650bce3c55cffc0729fd966a21441b8a1..d620f29fe9e375bf0d70a520bae9855289802602 100644 (file)
@@ -8,11 +8,12 @@ echo " which is needed to convert from Bacula version 1.38.x to 2.0.0 or higher"
 echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
-bindir=@SQL_BINDIR@
-db_name=@db_name@
 
-if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
+bindir=@POSTGRESQL_BINDIR@
+PATH="$bindir:$PATH"
+db_name=${db_name:-@db_name@}
 
+if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 ALTER TABLE media ADD COLUMN DeviceId integer;
 UPDATE media SET DeviceId=0;
 ALTER TABLE media ADD COLUMN MediaTypeId integer;
index 54a407d26f307bbf2c02f09e2f1f155cc57ba9ae..29f96eb5958d0d96a869d1c4fd0ed25804b04eea 100644 (file)
@@ -9,12 +9,12 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@SQLITE_BINDIR@
+PATH="$bindir:$PATH"
 cd @working_dir@
-sqlite=@DB_TYPE@
 db_name=@db_name@
 
-${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
+sqlite3 $* ${db_name}.db <<END-OF-DATA
 -- Can be replaced by 
 -- ALTER TABLE Job ADD COLUMN (ReadBytes BIGINT UNSIGNED DEFAULT 0);
 
index 64919cb6f78e470a2f4c8c232a77e87f2e47fe17..632913b5e98a74717b8132242465f6e14e3727e9 100644 (file)
@@ -7,13 +7,12 @@ echo "This script will update a Bacula SQLite3 database from version 11 to 12"
 echo " which is needed to convert from Bacula Community version 3.0.x to 5.0.x"
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@SQLITE_BINDIR@
 PATH="$bindir:$PATH"
 cd @working_dir@
-sqlite=@DB_TYPE@
 db_name=@db_name@
 
-DBV=`${sqlite} ${db_name} $sbin/regress.db <<END
+DBV=`${sqlite} ${db_name}.db <<END
 select VersionId from Version;
 END`
 if [ $DBVERSION != 11 ] ; then
@@ -25,8 +24,7 @@ if [ $DBVERSION != 11 ] ; then
    exit 1
 fi
 
-
-${sqlite} $* ${db_name}.db <<END-OF-DATA
+sqlite3 $* ${db_name}.db <<END-OF-DATA
 BEGIN;
 ALTER TABLE Job ADD COLUMN HasCache TINYINT DEFAULT 0;
 ALTER TABLE Job ADD COLUMN Reviewed TINYINT DEFAULT 0;
index 852859554a48b8ad305854162a82a0d02aed9080..cb813fdf6720767fe10fa7bfb4055741b01f53e0 100644 (file)
@@ -9,12 +9,12 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@SQLITE_BINDIR@
+PATH="$bindir:$PATH"
 cd @working_dir@
-sqlite=@DB_TYPE@
 db_name=@db_name@
 
-${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
+sqlite3 $* ${db_name}.db <<END-OF-DATA
 BEGIN TRANSACTION;
 
 CREATE TEMPORARY TABLE Media_backup (
index 10a88753a49e12c9e0e60d4b4d83431c9cd24599..ba14895202f41bd9427a321b7179fa964efb942c 100644 (file)
@@ -9,12 +9,12 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@SQLITE_BINDIR@
+PATH="$bindir:$PATH"
 cd @working_dir@
-sqlite=@DB_TYPE@
 db_name=@db_name@
 
-${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
+sqlite3 $* ${db_name}.db <<END-OF-DATA
 BEGIN TRANSACTION;
 
 CREATE TEMPORARY TABLE job_backup AS SELECT * FROM Job;
index 852859554a48b8ad305854162a82a0d02aed9080..cb813fdf6720767fe10fa7bfb4055741b01f53e0 100644 (file)
@@ -9,12 +9,12 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 
-bindir=@SQL_BINDIR@
+bindir=@SQLITE_BINDIR@
+PATH="$bindir:$PATH"
 cd @working_dir@
-sqlite=@DB_TYPE@
 db_name=@db_name@
 
-${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
+sqlite3 $* ${db_name}.db <<END-OF-DATA
 BEGIN TRANSACTION;
 
 CREATE TEMPORARY TABLE Media_backup (