ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/saveconfig

sparky cvs at pld-linux.org
Fri Mar 17 16:32:27 CET 2006


Author: sparky
Date: Fri Mar 17 16:32:25 2006
New Revision: 7208

Modified:
   ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/saveconfig
Log:
- few fixes, probably requires rewriting


Modified: ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/saveconfig
==============================================================================
--- ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/saveconfig	(original)
+++ ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/saveconfig	Fri Mar 17 16:32:25 2006
@@ -45,10 +45,11 @@
 diffs() {
 	while read FILE; do
 		[ -e "/live$FILE" ] && \
-			cmp "$FILE" "/live$FILE" 2>/dev/null && \
+			cmp "$FILE" "/live$FILE" >/dev/null 2>&1 && \
 			continue
-		[ "$FILE" -eq "/etc/fstab" ] && continue
-		[ "$FILE" -eq "/etc/mtab" ] && continue
+		[ -L "$FILE" ] && [ -L "/live$FILE" ] && continue
+		[ "$FILE" == "/etc/fstab" ] && continue
+		[ "$FILE" == "/etc/mtab" ] && continue
 		echo "$FILE" >> /tmp/changed
 		echo ": $FILE"
 	done
@@ -58,15 +59,18 @@
 echo /etc/fstab.add >> /tmp/changed
 egrep -v "(^#{0,1}none|^#/dev/hdXX|swap|^# Examples)" /etc/fstab > /etc/fstab.add
 
-sort -u /tmp/removed /tmp/changed > /tmp/different
+sort -u /tmp/removed /tmp/changed | sed 's@^/@@' > /tmp/different
 
 # xmltar | gzip checking for errors ##########################################
 echo "Archiving..."
 
 xmltar.pl -r < /tmp/different > /tmp/ppcrcd.xmltar || die 9 "Problem with xmltar"
-if [ "$OUT_FILE" -ne "$(echo "$OUT_FILE" | sed 's/\.gz$//')"]; then
+cd - > /dev/null
+if echo "$OUT_FILE" | egrep -q "\.gz$" ; then
 	echo "Gziping"
 	gzip -9 -c /tmp/ppcrcd.xmltar > "$OUT_DIR/$OUT_FILE" || die 10 "Can't gzip or save file"
+else
+	cat /tmp/ppcrcd.xmltar > "$OUT_DIR/$OUT_FILE" || die 10 "Can't save file"
 fi
 
 rm -rf /tmp/{removed,changed,different}


More information about the pld-cvs-commit mailing list