1 |
slords |
1.1 |
diff -up bacula-5.0.3/src/cats/Makefile.in.orig bacula-5.0.3/src/cats/Makefile.in |
2 |
|
|
--- bacula-5.0.3/src/cats/Makefile.in.orig 2010-10-06 14:37:54.000000000 +0200 |
3 |
|
|
+++ bacula-5.0.3/src/cats/Makefile.in 2010-10-06 14:41:35.000000000 +0200 |
4 |
|
|
@@ -134,12 +134,12 @@ libtool-uninstall: |
5 |
|
|
$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la |
6 |
|
|
|
7 |
|
|
install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@ |
8 |
|
|
- $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database |
9 |
|
|
- $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables |
10 |
|
|
- $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables |
11 |
|
|
- $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges |
12 |
|
|
- $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables |
13 |
|
|
- $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database |
14 |
|
|
+ $(INSTALL_SCRIPT) create_{sqlite3,mysql,postgresql}_database $(DESTDIR)$(scriptdir) |
15 |
|
|
+ $(INSTALL_SCRIPT) update_{sqlite3,mysql,postgresql}_tables $(DESTDIR)$(scriptdir) |
16 |
|
|
+ $(INSTALL_SCRIPT) make_{sqlite3,mysql,postgresql}_tables $(DESTDIR)$(scriptdir) |
17 |
|
|
+ $(INSTALL_SCRIPT) grant_{sqlite3,mysql,postgresql}_privileges $(DESTDIR)$(scriptdir) |
18 |
|
|
+ $(INSTALL_SCRIPT) drop_{sqlite3,mysql,postgresql}_tables $(DESTDIR)$(scriptdir) |
19 |
|
|
+ $(INSTALL_SCRIPT) drop_{sqlite3,mysql,postgresql}_database $(DESTDIR)$(scriptdir) |
20 |
|
|
|
21 |
|
|
$(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database |
22 |
|
|
$(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables |
23 |
|
|
@@ -177,12 +177,12 @@ install: @LIBTOOL_INSTALL_TARGET@ @INCLU |
24 |
|
|
$(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname |
25 |
|
|
|
26 |
|
|
uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@ |
27 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database) |
28 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables) |
29 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables) |
30 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges) |
31 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables) |
32 |
|
|
- (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database) |
33 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) create_{sqlite3,mysql,postgresql}_database) |
34 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) update_{sqlite3,mysql,postgresql}_tables) |
35 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) make_{sqlite3,mysql,postgresql}_tables) |
36 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) grant_{sqlite3,mysql,postgresql}_privileges) |
37 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) drop_{sqlite3,mysql,postgresql}_tables) |
38 |
|
|
+ (cd $(DESTDIR)$(scriptdir); $(RMF) drop_{sqlite3,mysql,postgresql}_database) |
39 |
|
|
|
40 |
|
|
(cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database) |
41 |
|
|
(cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables) |
42 |
|
|
diff -up bacula-5.0.3/src/cats/create_bacula_database.in.orig bacula-5.0.3/src/cats/create_bacula_database.in |
43 |
|
|
--- bacula-5.0.3/src/cats/create_bacula_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
44 |
|
|
+++ bacula-5.0.3/src/cats/create_bacula_database.in 2010-10-06 14:42:34.000000000 +0200 |
45 |
|
|
@@ -3,18 +3,7 @@ |
46 |
|
|
# This routine creates the Bacula database |
47 |
|
|
# using PostgreSQL, Ingres, MySQL, or SQLite. |
48 |
|
|
# |
49 |
|
|
-if test xsqlite3 = x@DB_TYPE@ ; then |
50 |
|
|
- echo "Creating SQLite database" |
51 |
|
|
- @scriptdir@/create_@DB_TYPE@_database |
52 |
|
|
-else |
53 |
|
|
- if test xmysql = x@DB_TYPE@ ; then |
54 |
|
|
- echo "Creating MySQL database" |
55 |
|
|
- @scriptdir@/create_mysql_database $* |
56 |
|
|
- elif test xingres = x@DB_TYPE@ ; then |
57 |
|
|
- echo "Creating Ingres database with $*" |
58 |
|
|
- @scriptdir@/create_ingres_database $* |
59 |
|
|
- else |
60 |
|
|
- echo "Creating PostgreSQL database" |
61 |
|
|
- @scriptdir@/create_postgresql_database $* |
62 |
|
|
- fi |
63 |
|
|
-fi |
64 |
|
|
+DB_TYPE=`ls @scriptdir@/create_[mpsi]*_database | cut -d'_' -f2` |
65 |
|
|
+ |
66 |
|
|
+echo "Creating ${DB_TYPE} database" |
67 |
|
|
+@scriptdir@/create_${DB_TYPE}_database $* |
68 |
|
|
diff -up bacula-5.0.3/src/cats/create_ingres_database.in.orig bacula-5.0.3/src/cats/create_ingres_database.in |
69 |
|
|
--- bacula-5.0.3/src/cats/create_ingres_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
70 |
|
|
+++ bacula-5.0.3/src/cats/create_ingres_database.in 2010-10-06 14:43:21.000000000 +0200 |
71 |
|
|
@@ -5,8 +5,8 @@ |
72 |
|
|
|
73 |
|
|
bindir=@SQL_BINDIR@ |
74 |
|
|
PATH="$bindir:$PATH" |
75 |
|
|
-db_name=${db_name:-@db_name@} |
76 |
|
|
-db_user=${db_user:-@db_user@} |
77 |
|
|
+db_name=${DB_NAME:-@db_name@} |
78 |
|
|
+db_user=${DB_USER:-@db_user@} |
79 |
|
|
|
80 |
|
|
# use SQL_ASCII to be able to put any filename into |
81 |
|
|
# the database even those created with unusual character sets |
82 |
|
|
diff -up bacula-5.0.3/src/cats/create_mysql_database.in.orig bacula-5.0.3/src/cats/create_mysql_database.in |
83 |
|
|
--- bacula-5.0.3/src/cats/create_mysql_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
84 |
|
|
+++ bacula-5.0.3/src/cats/create_mysql_database.in 2010-10-06 14:44:01.000000000 +0200 |
85 |
|
|
@@ -4,7 +4,7 @@ |
86 |
|
|
# |
87 |
|
|
|
88 |
|
|
bindir=@SQL_BINDIR@ |
89 |
|
|
-db_name=@db_name@ |
90 |
|
|
+db_name=${DB_NAME:-@db_name@} |
91 |
|
|
|
92 |
|
|
if $bindir/mysql $* -f <<END-OF-DATA |
93 |
|
|
CREATE DATABASE ${db_name}; |
94 |
|
|
diff -up bacula-5.0.3/src/cats/create_postgresql_database.in.orig bacula-5.0.3/src/cats/create_postgresql_database.in |
95 |
|
|
--- bacula-5.0.3/src/cats/create_postgresql_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
96 |
|
|
+++ bacula-5.0.3/src/cats/create_postgresql_database.in 2010-10-06 14:44:59.000000000 +0200 |
97 |
|
|
@@ -4,7 +4,7 @@ |
98 |
|
|
# |
99 |
|
|
|
100 |
|
|
PATH="@SQL_BINDIR@:$PATH" |
101 |
|
|
-db_name=${db_name:-@db_name@} |
102 |
|
|
+db_name=${DB_NAME:-@db_name@} |
103 |
|
|
|
104 |
|
|
# |
105 |
|
|
# use SQL_ASCII to be able to put any filename into |
106 |
|
|
diff -up bacula-5.0.3/src/cats/create_sqlite3_database.in.orig bacula-5.0.3/src/cats/create_sqlite3_database.in |
107 |
|
|
--- bacula-5.0.3/src/cats/create_sqlite3_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
108 |
|
|
+++ bacula-5.0.3/src/cats/create_sqlite3_database.in 2010-10-06 14:53:30.000000000 +0200 |
109 |
|
|
@@ -4,8 +4,8 @@ |
110 |
|
|
|
111 |
|
|
bindir=@SQL_BINDIR@ |
112 |
|
|
cd @working_dir@ |
113 |
|
|
-sqlite=@DB_TYPE@ |
114 |
|
|
-db_name=@db_name@ |
115 |
|
|
+sqlite=sqlite3 |
116 |
|
|
+db_name=${DB_NAME:-@db_name@} |
117 |
|
|
|
118 |
|
|
${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA |
119 |
|
|
END-OF-DATA |
120 |
|
|
diff -up bacula-5.0.3/src/cats/delete_catalog_backup.in.orig bacula-5.0.3/src/cats/delete_catalog_backup.in |
121 |
|
|
--- bacula-5.0.3/src/cats/delete_catalog_backup.in.orig 2010-08-05 16:29:51.000000000 +0200 |
122 |
|
|
+++ bacula-5.0.3/src/cats/delete_catalog_backup.in 2010-10-06 14:54:12.000000000 +0200 |
123 |
|
|
@@ -2,6 +2,6 @@ |
124 |
|
|
# |
125 |
|
|
# This script deletes a catalog dump |
126 |
|
|
# |
127 |
|
|
-db_name=@db_name@ |
128 |
|
|
+db_name=${1:-@db_name@} |
129 |
|
|
|
130 |
|
|
rm -f @working_dir@/${db_name}.sql |
131 |
|
|
diff -up bacula-5.0.3/src/cats/drop_bacula_database.in.orig bacula-5.0.3/src/cats/drop_bacula_database.in |
132 |
|
|
--- bacula-5.0.3/src/cats/drop_bacula_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
133 |
|
|
+++ bacula-5.0.3/src/cats/drop_bacula_database.in 2010-10-06 14:54:57.000000000 +0200 |
134 |
|
|
@@ -3,16 +3,7 @@ |
135 |
|
|
# Drop Bacula database -- works for whatever is configured, |
136 |
|
|
# MySQL, SQLite, PostgreSQL, Ingres |
137 |
|
|
# |
138 |
|
|
-if test xsqlite3 = x@DB_TYPE@ ; then |
139 |
|
|
- @scriptdir@/drop_@DB_TYPE@_database $* |
140 |
|
|
-else |
141 |
|
|
- if test xmysql = x@DB_TYPE@ ; then |
142 |
|
|
- echo "Making MySQL database" |
143 |
|
|
- @scriptdir@/drop_mysql_database $* |
144 |
|
|
- elif test xingres = x@DB_TYPE@ ; then |
145 |
|
|
- echo "Dropping Ingres database" |
146 |
|
|
- @scriptdir@/drop_ingres_database $* |
147 |
|
|
- else |
148 |
|
|
- @scriptdir@/drop_postgresql_database $* |
149 |
|
|
- fi |
150 |
|
|
-fi |
151 |
|
|
+DB_TYPE=`ls @scriptdir@/drop_[mpsi]*_database | cut -d'_' -f2` |
152 |
|
|
+ |
153 |
|
|
+echo "Dropping ${DB_TYPE} database" |
154 |
|
|
+@scriptdir@/drop_${DB_TYPE}_database $* |
155 |
|
|
diff -up bacula-5.0.3/src/cats/drop_bacula_tables.in.orig bacula-5.0.3/src/cats/drop_bacula_tables.in |
156 |
|
|
--- bacula-5.0.3/src/cats/drop_bacula_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
157 |
|
|
+++ bacula-5.0.3/src/cats/drop_bacula_tables.in 2010-10-06 14:55:40.000000000 +0200 |
158 |
|
|
@@ -3,21 +3,7 @@ |
159 |
|
|
# Drop Bacula tables -- works for whatever is configured, |
160 |
|
|
# MySQL, SQLite, Ingres, or PostgreSQL |
161 |
|
|
# |
162 |
|
|
-if test xsqlite3 = x@DB_TYPE@ ; then |
163 |
|
|
- @scriptdir@/drop_@DB_TYPE@_tables $* |
164 |
|
|
- echo "Dropped SQLite tables" |
165 |
|
|
-else |
166 |
|
|
- if test xmysql = x@DB_TYPE@ ; then |
167 |
|
|
- echo "Making MySQL tables" |
168 |
|
|
- @scriptdir@/drop_mysql_tables $* |
169 |
|
|
- echo "Dropped MySQL tables" |
170 |
|
|
- elif test xingres = x@DB_TYPE@ ; then |
171 |
|
|
- echo "Dropping Ingres tables" |
172 |
|
|
- @scriptdir@/drop_ingres_tables $* |
173 |
|
|
- echo "Dropped Ingres tables" |
174 |
|
|
- else |
175 |
|
|
- # hardcoded database name - should be a parameter |
176 |
|
|
- @scriptdir@/drop_postgresql_tables $* |
177 |
|
|
- echo "Dropped PostgreSQL tables" |
178 |
|
|
- fi |
179 |
|
|
-fi |
180 |
|
|
+DB_TYPE=`ls @scriptdir@/drop_[mpsi]*_tables | cut -d'_' -f2` |
181 |
|
|
+ |
182 |
|
|
+echo "Dropping ${DB_TYPE} tables" |
183 |
|
|
+@scriptdir@/drop_${DB_TYPE}_tables $* |
184 |
|
|
diff -up bacula-5.0.3/src/cats/drop_ingres_database.in.orig bacula-5.0.3/src/cats/drop_ingres_database.in |
185 |
|
|
--- bacula-5.0.3/src/cats/drop_ingres_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
186 |
|
|
+++ bacula-5.0.3/src/cats/drop_ingres_database.in 2010-10-06 14:56:14.000000000 +0200 |
187 |
|
|
@@ -5,8 +5,8 @@ |
188 |
|
|
|
189 |
|
|
bindir=@SQL_BINDIR@ |
190 |
|
|
PATH="$bindir:$PATH" |
191 |
|
|
-db_name=${db_name:-@db_name@} |
192 |
|
|
-db_user=${db_user:-@db_user@} |
193 |
|
|
+db_name=${DB_NAME:-@db_name@} |
194 |
|
|
+db_user=${DB_USER:-@db_user@} |
195 |
|
|
|
196 |
|
|
if destroydb -u${db_user} ${db_name} |
197 |
|
|
then |
198 |
|
|
diff -up bacula-5.0.3/src/cats/drop_ingres_tables.in.orig bacula-5.0.3/src/cats/drop_ingres_tables.in |
199 |
|
|
--- bacula-5.0.3/src/cats/drop_ingres_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
200 |
|
|
+++ bacula-5.0.3/src/cats/drop_ingres_tables.in 2010-10-06 14:57:05.000000000 +0200 |
201 |
|
|
@@ -4,8 +4,8 @@ |
202 |
|
|
|
203 |
|
|
bindir=@SQL_BINDIR@ |
204 |
|
|
PATH="$bindir:$PATH" |
205 |
|
|
-db_name=${db_name:-@db_name@} |
206 |
|
|
-db_user=${db_user:-@db_user@} |
207 |
|
|
+db_name=${DB_NAME:-@db_name@} |
208 |
|
|
+db_user=${DB_USER:-@db_user@} |
209 |
|
|
|
210 |
|
|
sql -u${db_user} ${db_name} $* <<END-OF-DATA |
211 |
|
|
DROP TABLE Filename; |
212 |
|
|
diff -up bacula-5.0.3/src/cats/drop_mysql_database.in.orig bacula-5.0.3/src/cats/drop_mysql_database.in |
213 |
|
|
--- bacula-5.0.3/src/cats/drop_mysql_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
214 |
|
|
+++ bacula-5.0.3/src/cats/drop_mysql_database.in 2010-10-06 14:58:03.000000000 +0200 |
215 |
|
|
@@ -4,10 +4,9 @@ |
216 |
|
|
# |
217 |
|
|
|
218 |
|
|
bindir=@SQL_BINDIR@ |
219 |
|
|
-db_name=@db_name@ |
220 |
|
|
+db_name=${DB_NAME:-@db_name@} |
221 |
|
|
|
222 |
|
|
-if test xmysql = x@DB_TYPE@ ; then |
223 |
|
|
- $bindir/mysql $* -f <<END-OF-DATA |
224 |
|
|
+$bindir/mysql $* -f <<END-OF-DATA |
225 |
|
|
DROP DATABASE ${db_name}; |
226 |
|
|
END-OF-DATA |
227 |
|
|
if test $? -eq 0 ; then |
228 |
|
|
@@ -15,7 +14,4 @@ END-OF-DATA |
229 |
|
|
else |
230 |
|
|
echo "Drop of ${db_name} database failed." |
231 |
|
|
fi |
232 |
|
|
-else |
233 |
|
|
- echo "Bacula is not configured for a MySQL database." |
234 |
|
|
-fi |
235 |
|
|
exit 0 |
236 |
|
|
diff -up bacula-5.0.3/src/cats/drop_mysql_tables.in.orig bacula-5.0.3/src/cats/drop_mysql_tables.in |
237 |
|
|
--- bacula-5.0.3/src/cats/drop_mysql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
238 |
|
|
+++ bacula-5.0.3/src/cats/drop_mysql_tables.in 2010-10-06 14:58:34.000000000 +0200 |
239 |
|
|
@@ -3,7 +3,7 @@ |
240 |
|
|
# shell script to delete Bacula tables for MySQL |
241 |
|
|
|
242 |
|
|
bindir=@SQL_BINDIR@ |
243 |
|
|
-db_name=@db_name@ |
244 |
|
|
+db_name=${DB_NAME:-@db_name@} |
245 |
|
|
|
246 |
|
|
if $bindir/mysql $* <<END-OF-DATA |
247 |
|
|
USE ${db_name}; |
248 |
|
|
diff -up bacula-5.0.3/src/cats/drop_postgresql_database.in.orig bacula-5.0.3/src/cats/drop_postgresql_database.in |
249 |
|
|
--- bacula-5.0.3/src/cats/drop_postgresql_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
250 |
|
|
+++ bacula-5.0.3/src/cats/drop_postgresql_database.in 2010-10-06 14:59:04.000000000 +0200 |
251 |
|
|
@@ -4,7 +4,7 @@ |
252 |
|
|
# |
253 |
|
|
|
254 |
|
|
bindir=@SQL_BINDIR@ |
255 |
|
|
-db_name=@db_name@ |
256 |
|
|
+db_name=${DB_NAME:-@db_name@} |
257 |
|
|
|
258 |
|
|
if $bindir/dropdb ${db_name} |
259 |
|
|
then |
260 |
|
|
diff -up bacula-5.0.3/src/cats/drop_postgresql_tables.in.orig bacula-5.0.3/src/cats/drop_postgresql_tables.in |
261 |
|
|
--- bacula-5.0.3/src/cats/drop_postgresql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
262 |
|
|
+++ bacula-5.0.3/src/cats/drop_postgresql_tables.in 2010-10-06 14:59:28.000000000 +0200 |
263 |
|
|
@@ -3,7 +3,7 @@ |
264 |
|
|
# shell script to delete Bacula tables for PostgreSQL |
265 |
|
|
|
266 |
|
|
bindir=@SQL_BINDIR@ |
267 |
|
|
-db_name=@db_name@ |
268 |
|
|
+db_name=${DB_NAME:-@db_name@} |
269 |
|
|
|
270 |
|
|
$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA |
271 |
|
|
drop table unsavedfiles; |
272 |
|
|
diff -up bacula-5.0.3/src/cats/drop_sqlite3_database.in.orig bacula-5.0.3/src/cats/drop_sqlite3_database.in |
273 |
|
|
--- bacula-5.0.3/src/cats/drop_sqlite3_database.in.orig 2010-08-05 16:29:51.000000000 +0200 |
274 |
|
|
+++ bacula-5.0.3/src/cats/drop_sqlite3_database.in 2010-10-06 15:00:03.000000000 +0200 |
275 |
|
|
@@ -1,13 +1,8 @@ |
276 |
|
|
#!/bin/sh |
277 |
|
|
# |
278 |
|
|
# shell script to drop Bacula SQLite tables |
279 |
|
|
-db_name=@db_name@ |
280 |
|
|
+db_name=${DB_NAME:-@db_name@} |
281 |
|
|
|
282 |
|
|
- |
283 |
|
|
-if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then |
284 |
|
|
cd @working_dir@ |
285 |
|
|
rm -rf ${db_name}.db |
286 |
|
|
echo "SQLite database dropped." |
287 |
|
|
-else |
288 |
|
|
- echo "Bacula is not configured for an SQLite database." |
289 |
|
|
-fi |
290 |
|
|
diff -up bacula-5.0.3/src/cats/drop_sqlite3_tables.in.orig bacula-5.0.3/src/cats/drop_sqlite3_tables.in |
291 |
|
|
--- bacula-5.0.3/src/cats/drop_sqlite3_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
292 |
|
|
+++ bacula-5.0.3/src/cats/drop_sqlite3_tables.in 2010-10-06 15:00:33.000000000 +0200 |
293 |
|
|
@@ -3,6 +3,6 @@ |
294 |
|
|
# shell script to Delete the SQLite Bacula database (same as deleting |
295 |
|
|
# the tables) |
296 |
|
|
# |
297 |
|
|
-db_name=@db_name@ |
298 |
|
|
+db_name=${DB_NAME:-@db_name@} |
299 |
|
|
|
300 |
|
|
rm -f @working_dir@/${db_name}.db |
301 |
|
|
diff -up bacula-5.0.3/src/cats/grant_bacula_privileges.in.orig bacula-5.0.3/src/cats/grant_bacula_privileges.in |
302 |
|
|
--- bacula-5.0.3/src/cats/grant_bacula_privileges.in.orig 2010-08-05 16:29:51.000000000 +0200 |
303 |
|
|
+++ bacula-5.0.3/src/cats/grant_bacula_privileges.in 2010-10-06 15:01:31.000000000 +0200 |
304 |
|
|
@@ -4,20 +4,7 @@ |
305 |
|
|
# Bacula tables for PostgreSQL or MySQL. |
306 |
|
|
# SQLite does not have permissions. |
307 |
|
|
# |
308 |
|
|
-if test xmysql = x@DB_TYPE@ ; then |
309 |
|
|
- echo "Granting MySQL privileges" |
310 |
|
|
- @scriptdir@/grant_mysql_privileges $* |
311 |
|
|
-else |
312 |
|
|
- if test xpostgresql = x@DB_TYPE@ ; then |
313 |
|
|
- echo "Granting PostgreSQL privileges" |
314 |
|
|
- @scriptdir@/grant_postgresql_privileges $* |
315 |
|
|
- elif test xingres = x@DB_TYPE@ ; then |
316 |
|
|
- echo "Granting Ingres privileges" |
317 |
|
|
- @scriptdir@/grant_ingres_privileges $* |
318 |
|
|
- else |
319 |
|
|
- if test xsqlite3 = x@DB_TYPE@ ; then |
320 |
|
|
- echo "Granting SQLite privileges" |
321 |
|
|
- @scriptdir@/grant_@DB_TYPE@_privileges $* |
322 |
|
|
- fi |
323 |
|
|
- fi |
324 |
|
|
-fi |
325 |
|
|
+DB_TYPE=`ls @scriptdir@/grant_[mpsi]*_privileges | cut -d'_' -f2` |
326 |
|
|
+ |
327 |
|
|
+echo "Granting ${DB_TYPE} privileges" |
328 |
|
|
+@scriptdir@/grant_${DB_TYPE}_privileges $* |
329 |
|
|
diff -up bacula-5.0.3/src/cats/grant_ingres_privileges.in.orig bacula-5.0.3/src/cats/grant_ingres_privileges.in |
330 |
|
|
--- bacula-5.0.3/src/cats/grant_ingres_privileges.in.orig 2010-08-05 16:29:51.000000000 +0200 |
331 |
|
|
+++ bacula-5.0.3/src/cats/grant_ingres_privileges.in 2010-10-06 15:02:08.000000000 +0200 |
332 |
|
|
@@ -4,8 +4,8 @@ |
333 |
|
|
# |
334 |
|
|
bindir=@SQL_BINDIR@ |
335 |
|
|
PATH="$bindir:$PATH" |
336 |
|
|
-db_name=${db_name:-@db_name@} |
337 |
|
|
-db_user=${db_user:-@db_user@} |
338 |
|
|
+db_name=${DB_NAME:-@db_name@} |
339 |
|
|
+db_user=${DB_USER:-@db_user@} |
340 |
|
|
|
341 |
|
|
sql iidbdb $* <<END-OF-DATA |
342 |
|
|
CREATE USER ${db_user} |
343 |
|
|
diff -up bacula-5.0.3/src/cats/grant_mysql_privileges.in.orig bacula-5.0.3/src/cats/grant_mysql_privileges.in |
344 |
|
|
--- bacula-5.0.3/src/cats/grant_mysql_privileges.in.orig 2010-08-05 16:29:51.000000000 +0200 |
345 |
|
|
+++ bacula-5.0.3/src/cats/grant_mysql_privileges.in 2010-10-06 15:03:17.000000000 +0200 |
346 |
|
|
@@ -2,9 +2,9 @@ |
347 |
|
|
# |
348 |
|
|
# shell script to grant privileges to the bacula database |
349 |
|
|
# |
350 |
|
|
-db_user=${db_user:-@db_user@} |
351 |
|
|
bindir=@SQL_BINDIR@ |
352 |
|
|
-db_name=${db_name:-@db_name@} |
353 |
|
|
+db_name=${DB_NAME:-@db_name@} |
354 |
|
|
+db_user=${DB_USER:-@db_user@} |
355 |
|
|
|
356 |
|
|
if $bindir/mysql $* -u root -f <<END-OF-DATA |
357 |
|
|
use mysql |
358 |
|
|
diff -up bacula-5.0.3/src/cats/grant_postgresql_privileges.in.orig bacula-5.0.3/src/cats/grant_postgresql_privileges.in |
359 |
|
|
--- bacula-5.0.3/src/cats/grant_postgresql_privileges.in.orig 2010-08-05 16:29:51.000000000 +0200 |
360 |
|
|
+++ bacula-5.0.3/src/cats/grant_postgresql_privileges.in 2010-10-06 15:04:01.000000000 +0200 |
361 |
|
|
@@ -2,9 +2,9 @@ |
362 |
|
|
# |
363 |
|
|
# shell script to grant privileges to the bacula database |
364 |
|
|
# |
365 |
|
|
-db_user=${db_user:-@db_user@} |
366 |
|
|
bindir=@SQL_BINDIR@ |
367 |
|
|
-db_name=${db_name:-@db_name@} |
368 |
|
|
+db_name=${DB_NAME:-@db_name@} |
369 |
|
|
+db_user=${DB_USER:-@db_user@} |
370 |
|
|
|
371 |
|
|
$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA |
372 |
|
|
|
373 |
|
|
diff -up bacula-5.0.3/src/cats/make_bacula_tables.in.orig bacula-5.0.3/src/cats/make_bacula_tables.in |
374 |
|
|
--- bacula-5.0.3/src/cats/make_bacula_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
375 |
|
|
+++ bacula-5.0.3/src/cats/make_bacula_tables.in 2010-10-06 15:04:32.000000000 +0200 |
376 |
|
|
@@ -3,18 +3,7 @@ |
377 |
|
|
# This routine makes the appropriately configured |
378 |
|
|
# Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite. |
379 |
|
|
# |
380 |
|
|
-if test xsqlite3 = x@DB_TYPE@ ; then |
381 |
|
|
- echo "Making SQLite tables" |
382 |
|
|
- @scriptdir@/make_@DB_TYPE@_tables $* |
383 |
|
|
-else |
384 |
|
|
- if test xmysql = x@DB_TYPE@ ; then |
385 |
|
|
- echo "Making MySQL tables" |
386 |
|
|
- @scriptdir@/make_mysql_tables $* |
387 |
|
|
- elif test xingres = x@DB_TYPE@ ; then |
388 |
|
|
- echo "Making Ingres tables" |
389 |
|
|
- @scriptdir@/make_ingres_tables $* |
390 |
|
|
- else |
391 |
|
|
- echo "Making PostgreSQL tables" |
392 |
|
|
- @scriptdir@/make_postgresql_tables $* |
393 |
|
|
- fi |
394 |
|
|
-fi |
395 |
|
|
+DB_TYPE=`ls @scriptdir@/make_[mpsi]*_tables | cut -d'_' -f2` |
396 |
|
|
+ |
397 |
|
|
+echo "Making ${DB_TYPE} tables" |
398 |
|
|
+@scriptdir@/make_${DB_TYPE}_tables $* |
399 |
|
|
diff -up bacula-5.0.3/src/cats/make_catalog_backup.in.orig bacula-5.0.3/src/cats/make_catalog_backup.in |
400 |
|
|
--- bacula-5.0.3/src/cats/make_catalog_backup.in.orig 2010-08-05 16:29:51.000000000 +0200 |
401 |
|
|
+++ bacula-5.0.3/src/cats/make_catalog_backup.in 2010-10-06 15:06:07.000000000 +0200 |
402 |
|
|
@@ -17,14 +17,12 @@ |
403 |
|
|
# (default "") |
404 |
|
|
# |
405 |
|
|
# |
406 |
|
|
+DB_TYPE=`ls @scriptdir@/create_[mpsi]*_database | cut -d'_' -f2` |
407 |
|
|
BINDIR=@SQL_BINDIR@ |
408 |
|
|
|
409 |
|
|
cd @working_dir@ |
410 |
|
|
rm -f $1.sql |
411 |
|
|
-if test xsqlite = x@DB_TYPE@ ; then |
412 |
|
|
- echo ".dump" | ${BINDIR}/sqlite $1.db >$1.sql |
413 |
|
|
-else |
414 |
|
|
- if test xmysql = x@DB_TYPE@ ; then |
415 |
|
|
+ if test xmysql = x${DB_TYPE}; then |
416 |
|
|
if test $# -gt 2; then |
417 |
|
|
MYSQLPASSWORD=" --password=$3" |
418 |
|
|
else |
419 |
|
|
@@ -37,7 +35,7 @@ else |
420 |
|
|
fi |
421 |
|
|
${BINDIR}/mysqldump -u ${2}${MYSQLPASSWORD}${MYSQLHOST} -f --opt $1 >$1.sql |
422 |
|
|
else |
423 |
|
|
- if test xpostgresql = x@DB_TYPE@ ; then |
424 |
|
|
+ if test xpostgresql = x${DB_TYPE}; then |
425 |
|
|
if test $# -gt 2; then |
426 |
|
|
PGPASSWORD=$3 |
427 |
|
|
export PGPASSWORD |
428 |
|
|
@@ -53,7 +51,6 @@ else |
429 |
|
|
echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql |
430 |
|
|
fi |
431 |
|
|
fi |
432 |
|
|
-fi |
433 |
|
|
# |
434 |
|
|
# To read back a MySQL database use: |
435 |
|
|
# cd @working_dir@ |
436 |
|
|
diff -up bacula-5.0.3/src/cats/make_catalog_backup.pl.in.orig bacula-5.0.3/src/cats/make_catalog_backup.pl.in |
437 |
|
|
--- bacula-5.0.3/src/cats/make_catalog_backup.pl.in.orig 2010-08-05 16:29:51.000000000 +0200 |
438 |
|
|
+++ bacula-5.0.3/src/cats/make_catalog_backup.pl.in 2010-10-06 15:07:05.000000000 +0200 |
439 |
|
|
@@ -44,7 +44,7 @@ use strict; |
440 |
|
|
$ENV{PATH}="@SQL_BINDIR@:$ENV{PATH}"; |
441 |
|
|
|
442 |
|
|
my $cat = shift or die "Usage: $0 catalogname"; |
443 |
|
|
-my $dir_conf='@sbindir@/dbcheck -B -c @sysconfdir@/bacula-dir.conf'; |
444 |
|
|
+my $dir_conf='@bindir@/dbcheck -B -c @sysconfdir@/bacula-dir.conf'; |
445 |
|
|
my $wd = "@working_dir@"; |
446 |
|
|
|
447 |
|
|
sub dump_sqlite |
448 |
|
|
diff -up bacula-5.0.3/src/cats/make_ingres_tables.in.orig bacula-5.0.3/src/cats/make_ingres_tables.in |
449 |
|
|
--- bacula-5.0.3/src/cats/make_ingres_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
450 |
|
|
+++ bacula-5.0.3/src/cats/make_ingres_tables.in 2010-10-06 15:07:36.000000000 +0200 |
451 |
|
|
@@ -3,7 +3,7 @@ |
452 |
|
|
# shell script to create Bacula PostgreSQL tables |
453 |
|
|
# |
454 |
|
|
bindir=@SQL_BINDIR@ |
455 |
|
|
-db_name=${db_name:-@db_name@} |
456 |
|
|
+db_name=${DB_NAME:-@db_name@} |
457 |
|
|
|
458 |
|
|
sql $* ${db_name} <<END-OF-DATA |
459 |
|
|
|
460 |
|
|
diff -up bacula-5.0.3/src/cats/make_mysql_tables.in.orig bacula-5.0.3/src/cats/make_mysql_tables.in |
461 |
|
|
--- bacula-5.0.3/src/cats/make_mysql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
462 |
|
|
+++ bacula-5.0.3/src/cats/make_mysql_tables.in 2010-10-06 15:08:00.000000000 +0200 |
463 |
|
|
@@ -4,7 +4,7 @@ |
464 |
|
|
# |
465 |
|
|
bindir=@SQL_BINDIR@ |
466 |
|
|
PATH="$bindir:$PATH" |
467 |
|
|
-db_name=${db_name:-@db_name@} |
468 |
|
|
+db_name=${DB_NAME:-@db_name@} |
469 |
|
|
|
470 |
|
|
if mysql $* -f <<END-OF-DATA |
471 |
|
|
USE ${db_name}; |
472 |
|
|
diff -up bacula-5.0.3/src/cats/make_postgresql_tables.in.orig bacula-5.0.3/src/cats/make_postgresql_tables.in |
473 |
|
|
--- bacula-5.0.3/src/cats/make_postgresql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
474 |
|
|
+++ bacula-5.0.3/src/cats/make_postgresql_tables.in 2010-10-06 15:08:29.000000000 +0200 |
475 |
|
|
@@ -4,7 +4,7 @@ |
476 |
|
|
# |
477 |
|
|
bindir=@SQL_BINDIR@ |
478 |
|
|
PATH="$bindir:$PATH" |
479 |
|
|
-db_name=${db_name:-@db_name@} |
480 |
|
|
+db_name=${DB_NAME:-@db_name@} |
481 |
|
|
|
482 |
|
|
psql -f - -d ${db_name} $* <<END-OF-DATA |
483 |
|
|
|
484 |
|
|
diff -up bacula-5.0.3/src/cats/make_sqlite3_tables.in.orig bacula-5.0.3/src/cats/make_sqlite3_tables.in |
485 |
|
|
--- bacula-5.0.3/src/cats/make_sqlite3_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
486 |
|
|
+++ bacula-5.0.3/src/cats/make_sqlite3_tables.in 2010-10-06 15:09:05.000000000 +0200 |
487 |
|
|
@@ -5,8 +5,8 @@ |
488 |
|
|
bindir=@SQL_BINDIR@ |
489 |
|
|
PATH="$bindir:$PATH" |
490 |
|
|
cd @working_dir@ |
491 |
|
|
-sqlite=@DB_TYPE@ |
492 |
|
|
-db_name=@db_name@ |
493 |
|
|
+sqlite=sqlite3 |
494 |
|
|
+db_name=${DB_NAME:-@db_name@} |
495 |
|
|
|
496 |
|
|
${sqlite} $* ${db_name}.db <<END-OF-DATA |
497 |
|
|
CREATE TABLE Filename ( |
498 |
|
|
diff -up bacula-5.0.3/src/cats/mysql.in.orig bacula-5.0.3/src/cats/mysql.in |
499 |
|
|
--- bacula-5.0.3/src/cats/mysql.in.orig 2010-08-05 16:29:51.000000000 +0200 |
500 |
|
|
+++ bacula-5.0.3/src/cats/mysql.in 2010-10-06 15:10:48.000000000 +0200 |
501 |
|
|
@@ -3,6 +3,6 @@ |
502 |
|
|
# shell script to create Bacula MySQL tables |
503 |
|
|
# |
504 |
|
|
bindir=@SQL_BINDIR@ |
505 |
|
|
-db_name=@db_name@ |
506 |
|
|
+db_name=${DB_NAME:-@db_name@} |
507 |
|
|
|
508 |
|
|
$bindir/mysql $* ${db_name} |
509 |
|
|
diff -up bacula-5.0.3/src/cats/postgresql.in.orig bacula-5.0.3/src/cats/postgresql.in |
510 |
|
|
--- bacula-5.0.3/src/cats/postgresql.in.orig 2010-08-05 16:29:51.000000000 +0200 |
511 |
|
|
+++ bacula-5.0.3/src/cats/postgresql.in 2010-10-06 15:11:09.000000000 +0200 |
512 |
|
|
@@ -3,6 +3,6 @@ |
513 |
|
|
# shell script to create Bacula PostgreSQL tables |
514 |
|
|
# |
515 |
|
|
bindir=@SQL_BINDIR@ |
516 |
|
|
-db_name=@db_name@ |
517 |
|
|
+db_name=${DB_NAME:-@db_name@} |
518 |
|
|
|
519 |
|
|
$bindir/psql $* ${db_name} |
520 |
|
|
diff -up bacula-5.0.3/src/cats/sqlite.in.orig bacula-5.0.3/src/cats/sqlite.in |
521 |
|
|
--- bacula-5.0.3/src/cats/sqlite.in.orig 2010-08-05 16:29:51.000000000 +0200 |
522 |
|
|
+++ bacula-5.0.3/src/cats/sqlite.in 2010-10-06 15:11:52.000000000 +0200 |
523 |
|
|
@@ -3,5 +3,6 @@ |
524 |
|
|
# shell script to invoke SQLite on Bacula database |
525 |
|
|
|
526 |
|
|
bindir=@SQL_BINDIR@ |
527 |
|
|
-db_name=@db_name@ |
528 |
|
|
-$bindir/sqlite @working_dir@/${db_name}.db |
529 |
|
|
+db_name=${DB_NAME:-@db_name@} |
530 |
|
|
+ |
531 |
|
|
+$bindir/sqlite3 @working_dir@/${db_name}.db |
532 |
|
|
diff -up bacula-5.0.3/src/cats/update_bacula_tables.in.orig bacula-5.0.3/src/cats/update_bacula_tables.in |
533 |
|
|
--- bacula-5.0.3/src/cats/update_bacula_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
534 |
|
|
+++ bacula-5.0.3/src/cats/update_bacula_tables.in 2010-10-06 15:12:36.000000000 +0200 |
535 |
|
|
@@ -3,19 +3,7 @@ |
536 |
|
|
# This routine alters the appropriately configured |
537 |
|
|
# Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite. |
538 |
|
|
# |
539 |
|
|
-if test xsqlite3 = x@DB_TYPE@ ; then |
540 |
|
|
- echo "Altering SQLite tables" |
541 |
|
|
- @scriptdir@/update_@DB_TYPE@_tables $* |
542 |
|
|
-fi |
543 |
|
|
-if test xmysql = x@DB_TYPE@ ; then |
544 |
|
|
- echo "Altering MySQL tables" |
545 |
|
|
- @scriptdir@/update_mysql_tables $* |
546 |
|
|
-fi |
547 |
|
|
-if test xingres = x@DB_TYPE@ ; then |
548 |
|
|
- echo "Altering Ingres tables" |
549 |
|
|
- @scriptdir@/update_ingres_tables $* |
550 |
|
|
-fi |
551 |
|
|
-if test xpostgresql = x@DB_TYPE@ ; then |
552 |
|
|
- echo "Altering PostgreSQL tables" |
553 |
|
|
- @scriptdir@/update_postgresql_tables $* |
554 |
|
|
-fi |
555 |
|
|
+DB_TYPE=`ls @scriptdir@/update_[mpsi]*_tables | cut -d'_' -f2` |
556 |
|
|
+ |
557 |
|
|
+echo "Altering ${DB_TYPE} tables" |
558 |
|
|
+@scriptdir@/update_${DB_TYPE}_tables $* |
559 |
|
|
diff -up bacula-5.0.3/src/cats/update_ingres_tables.in.orig bacula-5.0.3/src/cats/update_ingres_tables.in |
560 |
|
|
--- bacula-5.0.3/src/cats/update_ingres_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
561 |
|
|
+++ bacula-5.0.3/src/cats/update_ingres_tables.in 2010-10-06 15:13:03.000000000 +0200 |
562 |
|
|
@@ -6,7 +6,7 @@ echo " " |
563 |
|
|
echo "This script will update a Bacula Ingres database (if needed)" |
564 |
|
|
echo " " |
565 |
|
|
bindir=@SQL_BINDIR@ |
566 |
|
|
-db_name=@db_name@ |
567 |
|
|
+db_name=${DB_NAME:-@db_name@} |
568 |
|
|
|
569 |
|
|
echo "Update of Bacula Ingres tables succeeded. (nothing to do)" |
570 |
|
|
exit 0 |
571 |
|
|
diff -up bacula-5.0.3/src/cats/update_mysql_tables.in.orig bacula-5.0.3/src/cats/update_mysql_tables.in |
572 |
|
|
--- bacula-5.0.3/src/cats/update_mysql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
573 |
|
|
+++ bacula-5.0.3/src/cats/update_mysql_tables.in 2010-10-06 15:13:40.000000000 +0200 |
574 |
|
|
@@ -10,7 +10,7 @@ echo " Standard version 3.0 to 5.0" |
575 |
|
|
echo " " |
576 |
|
|
bindir=@SQL_BINDIR@ |
577 |
|
|
PATH="$bindir:$PATH" |
578 |
|
|
-db_name=@db_name@ |
579 |
|
|
+db_name=${DB_NAME:-@db_name@} |
580 |
|
|
|
581 |
|
|
if mysql $* -f <<END-OF-DATA |
582 |
|
|
USE ${db_name}; |
583 |
|
|
diff -up bacula-5.0.3/src/cats/update_postgresql_tables.in.orig bacula-5.0.3/src/cats/update_postgresql_tables.in |
584 |
|
|
--- bacula-5.0.3/src/cats/update_postgresql_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
585 |
|
|
+++ bacula-5.0.3/src/cats/update_postgresql_tables.in 2010-10-06 15:14:31.000000000 +0200 |
586 |
|
|
@@ -10,7 +10,7 @@ echo " " |
587 |
|
|
|
588 |
|
|
bindir=@SQL_BINDIR@ |
589 |
|
|
PATH="$bindir:$PATH" |
590 |
|
|
-db_name=@db_name@ |
591 |
|
|
+db_name=${DB_NAME:-@db_name@} |
592 |
|
|
|
593 |
|
|
if psql -f - -d ${db_name} $* <<END-OF-DATA |
594 |
|
|
BEGIN; -- Necessary for Bacula core |
595 |
|
|
diff -up bacula-5.0.3/src/cats/update_sqlite3_tables.in.orig bacula-5.0.3/src/cats/update_sqlite3_tables.in |
596 |
|
|
--- bacula-5.0.3/src/cats/update_sqlite3_tables.in.orig 2010-08-05 16:29:51.000000000 +0200 |
597 |
|
|
+++ bacula-5.0.3/src/cats/update_sqlite3_tables.in 2010-10-06 15:14:58.000000000 +0200 |
598 |
|
|
@@ -14,8 +14,8 @@ echo " " |
599 |
|
|
bindir=@SQL_BINDIR@ |
600 |
|
|
PATH="$bindir:$PATH" |
601 |
|
|
cd @working_dir@ |
602 |
|
|
-sqlite=@DB_TYPE@ |
603 |
|
|
-db_name=@db_name@ |
604 |
|
|
+sqlite=sqlite3 |
605 |
|
|
+db_name=${DB_NAME:-@db_name@} |
606 |
|
|
|
607 |
|
|
${sqlite} $* ${db_name}.db <<END-OF-DATA |
608 |
|
|
BEGIN; |