Package: backupninja Severity: minor Version: 0.9.4-6 Attached is a patch to fix a fairly irritating (though not, as far as I can tell, fatal) problem in the MySQL handler. Instead of doing half-baked things with stripping the word 'Databases' out of the output, we instead explicitly ask MySQL not to give us the header (-N) and also to not draw pretty boxes around the output (-B). We also send the query in via -e instead of a pipe because it's cleaner. Finally, because sometimes MySQL doesn't really listen to -B[1], we strip out the box if it was drawn anyway with a tasty bit of sed.
- Matt [1] It's not even MySQL version dependent -- I had an x86_64 machine draw the box while an i386 machine running the same packaged version not draw the box when given an identical command line. I have *no* idea how that happens.
diff -u backupninja-0.9.4/handlers/mysql backupninja-0.9.4/handlers/mysql
--- backupninja-0.9.4/handlers/mysql
+++ backupninja-0.9.4/handlers/mysql
@@ -237,7 +237,7 @@
fatal "Authentication problem, maybe user/password is wrong or
mysqld is not running?"
fi
else
- databases=`echo 'show databases' | su $user -c "$MYSQL
$defaultsfile" | grep -v Database`
+ databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show
databases'" | sed 's/|//g;/\+----/d')
if [ $? -ne 0 ]
then
fatal "Authentication problem, maybe user/password is wrong
or mysqld is not running?"
signature.asc
Description: Digital signature

