From 7c66b699f5820a9fab997a98d95e2852dd21a262 Mon Sep 17 00:00:00 2001
From: intrigeri <intrigeri@boum.org>
Date: Mon, 14 May 2012 16:30:02 +0200
Subject: [PATCH] Always use explicit sed's -e.

Hopefully this fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656968#31
and future incarnations of this class of bugs.
---
 handlers/rsync.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/handlers/rsync.in b/handlers/rsync.in
index c5c7cac..2d00267 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -275,7 +275,7 @@ function eval_config {
     mv=move_files
   fi
 
-  excludes=`echo "$exclude" | @SED@ "s/^/--exclude='/g" -e "s/ /' --exclude='/g" -e "s/$/'/"`
+  excludes=`echo "$exclude" | @SED@ -e "s/^/--exclude='/g" -e "s/ /' --exclude='/g" -e "s/$/'/"`
 
 }
 
@@ -406,7 +406,7 @@ function rotate_long {
     fi
     
     # Rotate the current list of backups, if we can.
-    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1`
+    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | @SED@ -e 's/^.*\.//' | sort -n | tail -1`
     [ "$oldest" == "" ] && oldest=0
     for (( i=$oldest; i > 0; i-- )); do
       if [ -d $dir.$i ]; then
@@ -468,7 +468,7 @@ function rotate_long {
   for rottype in daily weekly monthly; do
     max=$((keep${rottype}+1))
     dir="$backuproot/$rottype"
-    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1`
+    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | @SED@ -e 's/^.*\.//' | sort -n | tail -1`
     [ "$oldest" == "" ] && oldest=0 
     # if we've rotated the last backup off the stack, remove it.
     for (( i=$oldest; i >= $max; i-- )); do
@@ -529,7 +529,7 @@ function rotate_long_remote {
     fi
     
     # Rotate the current list of backups, if we can.
-    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\`
+    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ -e 's/^.*\.//' | sort -n | tail -1\`
     [ "\$oldest" == "" ] && oldest=0
     for (( i=\$oldest; i > 0; i-- )); do
       if [ -d \$dir.\$i ]; then
@@ -591,7 +591,7 @@ function rotate_long_remote {
   for rottype in daily weekly monthly; do
     max=\$((keep\${rottype}+1))
     dir="$backuproot/\$rottype"
-    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\`
+    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ -e 's/^.*\.//' | sort -n | tail -1\`
     [ "\$oldest" == "" ] && oldest=0 
     # if we've rotated the last backup off the stack, remove it.
     for (( i=\$oldest; i >= \$max; i-- )); do
-- 
GitLab