From 5827d2aa32c2194f68779dd8910b0633aafd571f Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 3 Dec 2007 20:28:19 +0000 Subject: backupninja: small fixes git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1496 370017ae-e619-0410-ac65-c121f96126d4 --- app/backup/backupninja/backupninja-0.9.5.diff | 88 ++++++++++----------------- 1 file changed, 31 insertions(+), 57 deletions(-) diff --git a/app/backup/backupninja/backupninja-0.9.5.diff b/app/backup/backupninja/backupninja-0.9.5.diff index 52b21414..ccca997b 100644 --- a/app/backup/backupninja/backupninja-0.9.5.diff +++ b/app/backup/backupninja/backupninja-0.9.5.diff @@ -1,13 +1,13 @@ diff -Naur backupninja-0.9.5.orig/handlers/mysql.in backupninja-0.9.5/handlers/mysql.in --- backupninja-0.9.5.orig/handlers/mysql.in 2007-11-19 23:28:49.000000000 -0200 -+++ backupninja-0.9.5/handlers/mysql.in 2007-12-03 17:16:10.000000000 -0200 ++++ backupninja-0.9.5/handlers/mysql.in 2007-12-03 18:20:25.000000000 -0200 @@ -91,8 +91,7 @@ then if [ $usevserver = yes ] then - vhome=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` - home="$vroot$vhome" -+ home=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` ++ home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` else home=`getent passwd "root" | @AWK@ -F: '{print $6}'` fi @@ -19,18 +19,18 @@ diff -Naur backupninja-0.9.5.orig/handlers/mysql.in backupninja-0.9.5/handlers/m - if [ -f $mycnf ] + + if [ $usevserver = yes ] - then -- # rename temporarily -- tmpcnf="$home/my.cnf.disable" -- debug "mv $mycnf $tmpcnf" -- mv $mycnf $tmpcnf ++ then + workcnf="$vroot$mycnf" + else + workcnf="$mycnf" + fi + + if [ -f $workcnf ] -+ then + then +- # rename temporarily +- tmpcnf="$home/my.cnf.disable" +- debug "mv $mycnf $tmpcnf" +- mv $mycnf $tmpcnf + # rename temporarily + tmpcnf="$workcnf.disable" + debug "mv $workcnf $tmpcnf" @@ -58,57 +58,31 @@ diff -Naur backupninja-0.9.5.orig/handlers/mysql.in backupninja-0.9.5/handlers/m fi # if a user is not set, use $configfile, otherwise use $mycnf -@@ -142,27 +143,28 @@ - user=root; - defaultsfile="--defaults-extra-file=$configfile" - else -- userset=true; -- if [ $usevserver = yes ] -- then +@@ -145,18 +146,21 @@ + userset=true; + if [ $usevserver = yes ] + then - vuserhome=`$VSERVER $vsname exec getent passwd "$user" | @AWK@ -F: '{print $6}'` -- if [ $? -eq 2 ] -- then -- fatal "User $user not found in /etc/passwd" -- fi ++ userhome=`$VSERVER $vsname exec getent passwd "$user" | @AWK@ -F: '{print $6}'` + if [ $? -eq 2 ] + then + fatal "User $user not found in /etc/passwd" + fi - userhome="$vroot$vuserhome" -- else -- userhome=`getent passwd "$user" | @AWK@ -F: '{print $6}'` -- if [ $? -eq 2 ] -- then -- fatal "User $user not found in /etc/passwd" -- fi -- fi -- -- debug "User home set to: $userhome" -- [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" -- defaultsfile="--defaults-extra-file=$userhome/.my.cnf" -- debug "using $defaultsfile" -+ userset=true; -+ if [ $usevserver = yes ] -+ then -+ userhome=`$VSERVER $vsname exec getent passwd "$user" | awk -F: '{print $6}'` -+ if [ $? -eq 2 ] -+ then -+ fatal "User $user not found in /etc/passwd" -+ fi -+ debug "User home set to: $vroot$userhome" -+ [ -f $vroot$userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" -+ else -+ userhome=`getent passwd "$user" | awk -F: '{print $6}'` -+ if [ $? -eq 2 ] -+ then -+ fatal "User $user not found in /etc/passwd" -+ fi -+ debug "User home set to: $userhome" -+ [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" -+ fi -+ -+ defaultsfile="--defaults-extra-file=$userhome/.my.cnf" -+ debug "using $defaultsfile" - fi - - ####################################################################### -@@ -310,12 +312,12 @@ ++ debug "User home set to: $vroot$userhome" ++ [ -f $vroot$userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" + else + userhome=`getent passwd "$user" | @AWK@ -F: '{print $6}'` + if [ $? -eq 2 ] + then + fatal "User $user not found in /etc/passwd" + fi ++ debug "User home set to: $userhome" ++ [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" + fi + + debug "User home set to: $userhome" +@@ -310,12 +314,12 @@ if [ "$dbusername" != "" -a "$dbpassword" != "" ] then ## clean up tmp config file -- cgit v1.2.3