From 8791b8b2b258ce8a8c1f34cbefc1e4b131aa479a Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Mon, 7 Nov 2011 20:01:49 +0100 Subject: [PATCH] Remove last traces of @SQL_BINDIR@ and @DB_TYPE@ 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. --- bacula/autoconf/bacula-macros/db.m4 | 8 ++--- bacula/platforms/gentoo/bacula-init.in | 2 +- .../suse/bacula-dir-suse-sqlite.patch | 4 +-- bacula/platforms/suse/bacula-dir.in | 4 +-- .../src/cats/create_sqlite3_database.in.patch | 4 +-- bacula/src/cats/make_catalog_backup.in.patch | 30 +++++++------------ bacula/src/cats/make_ingres_catalog_backup.in | 2 +- bacula/src/cats/make_sqlite3_tables.in.patch | 5 ++-- .../src/cats/restore_ingres_catalog_backup.in | 2 +- .../src/cats/update_sqlite3_tables.in.patch | 8 ++--- bacula/src/dird/bacula-dir.conf.in | 2 +- .../updatedb/update_mysql_tables_10_to_11.in | 7 +++-- .../updatedb/update_mysql_tables_11_to_12.in | 4 +-- .../updatedb/update_mysql_tables_9_to_10.in | 7 +++-- .../update_postgresql_tables_10_to_11.in | 8 ++--- .../update_postgresql_tables_11_to_12.in | 4 +-- .../update_postgresql_tables_9_to_10.in | 7 +++-- .../update_sqlite3_tables_10_to_11.in | 6 ++-- .../update_sqlite3_tables_11_to_12.in | 8 ++--- .../updatedb/update_sqlite3_tables_9_to_10.in | 6 ++-- .../updatedb/update_sqlite_tables_10_to_11.in | 6 ++-- .../updatedb/update_sqlite_tables_9_to_10.in | 6 ++-- 22 files changed, 67 insertions(+), 73 deletions(-) diff --git a/bacula/autoconf/bacula-macros/db.m4 b/bacula/autoconf/bacula-macros/db.m4 index 2678af593b..8ef51bbbce 100644 --- a/bacula/autoconf/bacula-macros/db.m4 +++ b/bacula/autoconf/bacula-macros/db.m4 @@ -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 diff --git a/bacula/platforms/gentoo/bacula-init.in b/bacula/platforms/gentoo/bacula-init.in index b3ddaa1a8f..0c78153f59 100755 --- a/bacula/platforms/gentoo/bacula-init.in +++ b/bacula/platforms/gentoo/bacula-init.in @@ -6,7 +6,7 @@ depend() { need net - use @DB_TYPE@ + use @DEFAULT_DB_TYPE@ } opts="test" diff --git a/bacula/platforms/suse/bacula-dir-suse-sqlite.patch b/bacula/platforms/suse/bacula-dir-suse-sqlite.patch index 8f5ce1f1cb..f5b0086027 100644 --- a/bacula/platforms/suse/bacula-dir-suse-sqlite.patch +++ b/bacula/platforms/suse/bacula-dir-suse-sqlite.patch @@ -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 diff --git a/bacula/platforms/suse/bacula-dir.in b/bacula/platforms/suse/bacula-dir.in index 5402a0de16..550b9ceff3 100755 --- a/bacula/platforms/suse/bacula-dir.in +++ b/bacula/platforms/suse/bacula-dir.in @@ -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 diff --git a/bacula/src/cats/create_sqlite3_database.in.patch b/bacula/src/cats/create_sqlite3_database.in.patch index faa83e640d..c82adc4a2f 100644 --- a/bacula/src/cats/create_sqlite3_database.in.patch +++ b/bacula/src/cats/create_sqlite3_database.in.patch @@ -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@ + diff --git a/bacula/src/cats/make_catalog_backup.in.patch b/bacula/src/cats/make_catalog_backup.in.patch index 7279dc005b..08988b26a7 100644 --- a/bacula/src/cats/make_catalog_backup.in.patch +++ b/bacula/src/cats/make_catalog_backup.in.patch @@ -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@ diff --git a/bacula/src/cats/make_ingres_catalog_backup.in b/bacula/src/cats/make_ingres_catalog_backup.in index 6bf784dca2..bcd0ce10e7 100755 --- a/bacula/src/cats/make_ingres_catalog_backup.in +++ b/bacula/src/cats/make_ingres_catalog_backup.in @@ -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@} diff --git a/bacula/src/cats/make_sqlite3_tables.in.patch b/bacula/src/cats/make_sqlite3_tables.in.patch index 06b577b2bb..f9a95082a1 100644 --- a/bacula/src/cats/make_sqlite3_tables.in.patch +++ b/bacula/src/cats/make_sqlite3_tables.in.patch @@ -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@ + diff --git a/bacula/src/cats/restore_ingres_catalog_backup.in b/bacula/src/cats/restore_ingres_catalog_backup.in index a12e101fd3..cc07732a08 100755 --- a/bacula/src/cats/restore_ingres_catalog_backup.in +++ b/bacula/src/cats/restore_ingres_catalog_backup.in @@ -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@} diff --git a/bacula/src/cats/update_sqlite3_tables.in.patch b/bacula/src/cats/update_sqlite3_tables.in.patch index 5b2a36b8de..252a0f3e66 100644 --- a/bacula/src/cats/update_sqlite3_tables.in.patch +++ b/bacula/src/cats/update_sqlite3_tables.in.patch @@ -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@ diff --git a/bacula/src/dird/bacula-dir.conf.in b/bacula/src/dird/bacula-dir.conf.in index 080d59a08a..5793ea1ff5 100644 --- a/bacula/src/dird/bacula-dir.conf.in +++ b/bacula/src/dird/bacula-dir.conf.in @@ -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@" } diff --git a/bacula/updatedb/update_mysql_tables_10_to_11.in b/bacula/updatedb/update_mysql_tables_10_to_11.in index e78a13592c..ea4a85cad4 100644 --- a/bacula/updatedb/update_mysql_tables_10_to_11.in +++ b/bacula/updatedb/update_mysql_tables_10_to_11.in @@ -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 </tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` diff --git a/bacula/updatedb/update_mysql_tables_9_to_10.in b/bacula/updatedb/update_mysql_tables_9_to_10.in index ce2fd2a62e..37228199b9 100644 --- a/bacula/updatedb/update_mysql_tables_9_to_10.in +++ b/bacula/updatedb/update_mysql_tables_9_to_10.in @@ -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 <