[SCM] live-debconfig branch, debian-next, updated. debian/4.0_a2-1-10-g8d9ce6b

Daniel Baumann daniel at debian.org
Thu Aug 16 13:22:10 UTC 2012


The following commit has been merged in the debian-next branch:
commit 8d9ce6b3d1f732bbdd377b3aab6bcb4f14a9aeac
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Aug 16 15:22:09 2012 +0200

    Making file operations in util-linux script atomic.

diff --git a/scripts/debconfig/0040-util-linux b/scripts/debconfig/0040-util-linux
index ffd7cf8..225606f 100755
--- a/scripts/debconfig/0040-util-linux
+++ b/scripts/debconfig/0040-util-linux
@@ -71,13 +71,19 @@ esac
 if [ -z "${HWCLOCKACCESS}" ]
 then
 	# uncommenting it
-	sed -i -e "s|^# *HWCLOCKACCESS=|HWCLOCKACCESS=|" \
-		/etc/default/hwclock
+	sed -e "s|^# *HWCLOCKACCESS=|HWCLOCKACCESS=|" \
+		/etc/default/hwclock > /etc/default/hwclock.tmp
+
+	mv /etc/default/hwclock.tmp /etc/default/hwclock
+else
+	cp /etc/default/hwclock /etc/default/hwclock.tmp
 fi
 
 # Set the hwclock parameters
-grep -Eq '^ *HWCLOCKACCESS=' /etc/default/hwclock || \
-	echo "HWCLOCKACCESS=" >> /etc/default/hwclock
+grep -Eq '^ *HWCLOCKACCESS=' /etc/default/hwclock.tmp || \
+	echo "HWCLOCKACCESS=" >> /etc/default/hwclock.tmp
 
 sed -i -e "s|^ *HWCLOCKACCESS=.*|HWCLOCKACCESS=\"${_HWCLOCKACCESS}\"|" \
-	/etc/default/hwclock
+	/etc/default/hwclock.tmp
+
+mv /etc/default/hwclock.tmp /etc/default/hwclock

-- 
live-debconfig



More information about the debian-live-changes mailing list