From d3a0659e1352fc61ac9a5e3771909cd5c107b977 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 22 May 2009 11:19:10 +0000 Subject: [PATCH] Added support for adding files that do not exist on the system. These files are removed later during the cleanup. --- tests/common/config.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/common/config.sh b/tests/common/config.sh index 1b958ea0..222501eb 100644 --- a/tests/common/config.sh +++ b/tests/common/config.sh @@ -11,7 +11,7 @@ save_config () while read file do mkdir -p "tmp/$(dirname "$file")" - [ -f "/$file" ] && cp -dp "/$file" "tmp/$file" + [ -f "/$file" ] && cp -dp "/$file" "tmp/$file" || true done } @@ -32,9 +32,12 @@ restore_config () find config -depth -path "*/.svn/*" -prune -o -type f -print | sed -e 's/config\///' | while read file do - [ -f "tmp/$file" ] && \ - cp -dp "tmp/$file" "/$file" && \ + if [ -f "tmp/$file" ]; then + cp -dp "tmp/$file" "/$file" rm "tmp/$file" + else + rm "/$file" + fi d="$(dirname "tmp/$file")" while [ -n "$d" ] && [ "$d" != "." ] do