aboutsummaryrefslogtreecommitdiff
path: root/app/backup
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2007-12-03 19:52:31 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2007-12-03 19:52:31 +0000
commit4a0fbced24f6b4431c90d9880288639fd489e42f (patch)
tree92fe7933fb72b71597dae96b3c97c0b16eb24f05 /app/backup
parent15d539782cd569654e6986448bf36cf25329d71c (diff)
downloadslackbuilds-4a0fbced24f6b4431c90d9880288639fd489e42f.tar.gz
slackbuilds-4a0fbced24f6b4431c90d9880288639fd489e42f.tar.bz2
backupninja: added patch for 0.9.5
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1494 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'app/backup')
-rw-r--r--app/backup/backupninja/backupninja-0.9.5.diff127
-rwxr-xr-xapp/backup/backupninja/backupninja.SlackBuild12
2 files changed, 139 insertions, 0 deletions
diff --git a/app/backup/backupninja/backupninja-0.9.5.diff b/app/backup/backupninja/backupninja-0.9.5.diff
new file mode 100644
index 00000000..52b21414
--- /dev/null
+++ b/app/backup/backupninja/backupninja-0.9.5.diff
@@ -0,0 +1,127 @@
+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
+@@ -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}'`
+ else
+ home=`getent passwd "root" | @AWK@ -F: '{print $6}'`
+ fi
+@@ -100,18 +99,25 @@
+ [ -d $home ] || fatal "Can't find root's home directory ($home)."
+
+ mycnf="$home/.my.cnf"
+-
+- if [ -f $mycnf ]
++
++ if [ $usevserver = yes ]
+ then
+- # rename temporarily
+- tmpcnf="$home/my.cnf.disable"
+- debug "mv $mycnf $tmpcnf"
+- mv $mycnf $tmpcnf
++ workcnf="$vroot$mycnf"
++ else
++ workcnf="$mycnf"
++ fi
++
++ if [ -f $workcnf ]
++ then
++ # rename temporarily
++ tmpcnf="$workcnf.disable"
++ debug "mv $workcnf $tmpcnf"
++ mv $workcnf $tmpcnf
+ fi
+
+ oldmask=`umask`
+ umask 077
+- cat > $mycnf <<EOF
++ cat > $workcnf <<EOF
+ # auto generated backupninja mysql conf
+ [mysql]
+ host=$dbhost
+@@ -129,12 +135,7 @@
+ password="$dbpassword"
+ EOF
+ umask $oldmask
+- if [ $usevserver = yes ]
+- then
+- defaultsfile="--defaults-extra-file=$vhome/.my.cnf"
+- else
+- defaultsfile="--defaults-extra-file=$mycnf"
+- fi
++ defaultsfile="--defaults-extra-file=$mycnf"
+ 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
+- 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="$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 @@
+ if [ "$dbusername" != "" -a "$dbpassword" != "" ]
+ then
+ ## clean up tmp config file
+- debug "rm $mycnf"
+- rm $mycnf
++ debug "rm $workcnf"
++ rm $workcnf
+ if [ -f "$tmpcnf" ]
+ then
+- debug "mv $tmpcnf $mycnf"
+- mv $tmpcnf $mycnf
++ debug "mv $tmpcnf $workcnf"
++ mv $tmpcnf $workcnf
+ fi
+ fi
+
diff --git a/app/backup/backupninja/backupninja.SlackBuild b/app/backup/backupninja/backupninja.SlackBuild
index fd5dd81d..66259d99 100755
--- a/app/backup/backupninja/backupninja.SlackBuild
+++ b/app/backup/backupninja/backupninja.SlackBuild
@@ -90,6 +90,18 @@ tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TA
PKG_SRC=`ls -l | awk '/^d/ { print $8 }'`
cd "$PKG_SRC"
+# Patch source
+patches="[[PATCH FILES]]
+ $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff
+ $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff"
+for patch in $patches; do
+ if [ -f "$CWD/$patch" ]; then
+ patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch" ]; then
+ patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/patches/$patch" || exit $ERROR_PATCH
+ fi
+done
+
# Configure
./autogen.sh || exit $ERROR_CONF
CFLAGS="$SLKCFLAGS" \