[SCM] debian-live/live-helper branch, master, updated. 1.0_a34-1-10-g51cfe60

Daniel Baumann daniel at debian.org
Sat Nov 10 14:41:20 UTC 2007


The branch, master has been updated
       via  51cfe60fc6b75ee214aff74a1e56543a98fd1f20 (commit)
      from  7cacae2d940e17a7627413bc934ea198de0ab486 (commit)


- Shortlog ------------------------------------------------------------
51cfe60 Using shell redirection to truncate rather than additional commands/forks/files, thanks to Justin Pryzby <jpryzby at quoininc.com>.

Summary of changes:
 functions/aliases.sh     |   18 ++++++++++++++++++
 helpers/lh_chroot_hosts  |    2 +-
 helpers/lh_chroot_resolv |    2 +-
 hooks/mini               |    2 +-
 hooks/minimal            |    2 +-
 5 files changed, 22 insertions(+), 4 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 51cfe60fc6b75ee214aff74a1e56543a98fd1f20
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Nov 10 15:40:53 2007 +0100

    Using shell redirection to truncate rather than additional commands/forks/files, thanks to Justin Pryzby <jpryzby at quoininc.com>.

diff --git a/functions/common.sh b/functions/aliases.sh
similarity index 74%
copy from functions/common.sh
copy to functions/aliases.sh
index 623c882..04efc24 100755
--- a/functions/common.sh
+++ b/functions/aliases.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# common.sh - common things for all live-helpers
+# aliases.sh - internal shell aliases
 # Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
 #
 # live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
@@ -9,5 +9,10 @@
 
 set -e
 
-PROGRAM="$(basename ${0})"
-VERSION="1.0~a35"
+Truncate ()
+{
+	for FILE in ${@}
+	do
+		: > ${FILE}
+	done
+}
diff --git a/helpers/lh_chroot_hosts b/helpers/lh_chroot_hosts
index 8480383..6a91831 100755
--- a/helpers/lh_chroot_hosts
+++ b/helpers/lh_chroot_hosts
@@ -89,7 +89,7 @@ EOF
 		else
 			# Blank out hosts file, don't remove in case
 			# its a symlink, as in the case of exposedroot mode
-			cat /dev/null > chroot/etc/hosts
+			Truncate chroot/etc/hosts
 		fi
 
 		# Removing stage file
diff --git a/helpers/lh_chroot_resolv b/helpers/lh_chroot_resolv
index eeeead2..bc53c68 100755
--- a/helpers/lh_chroot_resolv
+++ b/helpers/lh_chroot_resolv
@@ -80,7 +80,7 @@ case "${1}" in
 			mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf
 		else
 			# Truncating resolv file
-			cat < /dev/null > chroot/etc/resolv.conf
+			Truncate chroot/etc/resolv.conf
 		fi
 
 		# Removing stage file
diff --git a/hooks/mini b/hooks/mini
index 4910914..c33186e 100755
--- a/hooks/mini
+++ b/hooks/mini
@@ -40,5 +40,5 @@ mkdir -p /var/lib/apt/lists/partial
 # Truncating logs
 for FILE in $(find /var/log/ -type f)
 do
-	cat < /dev/null > $FILE
+	: > ${FILE}
 done
diff --git a/hooks/minimal b/hooks/minimal
index 3886d9a..ff57deb 100755
--- a/hooks/minimal
+++ b/hooks/minimal
@@ -32,5 +32,5 @@ mkdir -p /var/lib/apt/lists/partial
 # Truncating logs
 for FILE in $(find /var/log/ -type f)
 do
-	cat < /dev/null > $FILE
+	: > ${FILE}
 done

-- 
debian-live/live-helper



More information about the debian-live-changes mailing list