[SCM] live-boot branch, debian-next, updated. debian/3.0_a5-1-3-g82839c0

Marco Amadori amadorim at vdavda.com
Mon Sep 13 15:37:50 UTC 2010


The following commit has been merged in the debian-next branch:
commit 82839c0e534ac0f2c3b1260c09d44022d2a85187
Author: Marco Amadori <amadorim at vdavda.com>
Date:   Mon Sep 13 17:15:29 2010 +0200

    Added support for empty (initial) snapshots.
    
    Signed-off-by: Marco Amadori <amadorim at vdavda.com>

diff --git a/scripts/live b/scripts/live
index 07deb55..18881af 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1074,8 +1074,16 @@ try_snap ()
 				cpioargs='--unconditional --make-directories'
 			fi
 
-			cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null
-			RES="$?"
+			if [ -s "${snapback}/${snapfile}" ]
+			then
+				BEFOREDIR="$(pwd)"
+				cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null
+				RES="$?"
+				cd "${BEFOREDIR}"
+			else
+				log_warning_msg "${snapback}/${snapfile} is empty, adding it for sync on reboot."
+				RES="0"
+			fi
 
 			if [ "${RES}" != "0" ]
 			then

-- 
live-boot



More information about the debian-live-changes mailing list