[Pkg-shadow-commits] r2986 - debian/trunk/tests/common

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Fri May 22 11:19:10 UTC 2009


Author: nekral-guest
Date: 2009-05-22 11:19:10 +0000 (Fri, 22 May 2009)
New Revision: 2986

Modified:
   debian/trunk/tests/common/config.sh
Log:
Added support for adding files that do not exist on the system.
These files are removed later during the cleanup.


Modified: debian/trunk/tests/common/config.sh
===================================================================
--- debian/trunk/tests/common/config.sh	2009-05-22 11:18:07 UTC (rev 2985)
+++ debian/trunk/tests/common/config.sh	2009-05-22 11:19:10 UTC (rev 2986)
@@ -11,7 +11,7 @@
 	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 @@
 	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




More information about the Pkg-shadow-commits mailing list