[SCM] debian-live/live-helper branch, master, updated. 1.0_a35-1-16-gd7fb22c

Daniel Baumann daniel at debian.org
Sun Nov 11 21:03:49 UTC 2007


The branch, master has been updated
       via  d7fb22ca8b4a5d1d58be259994943c5b271d0ab0 (commit)
      from  be5c114a90275c73d95385303a91d6f4273be828 (commit)


- Shortlog ------------------------------------------------------------
d7fb22c Extending --force to also cover lockfiles to avoid recursive loop within trap.

Summary of changes:
 functions/lockfile.sh |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit d7fb22ca8b4a5d1d58be259994943c5b271d0ab0
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Nov 11 22:03:02 2007 +0100

    Extending --force to also cover lockfiles to avoid recursive loop within trap.

diff --git a/functions/lockfile.sh b/functions/lockfile.sh
index 8af6757..eda8d81 100755
--- a/functions/lockfile.sh
+++ b/functions/lockfile.sh
@@ -23,15 +23,18 @@ Check_lockfile ()
 
 Create_lockfile ()
 {
-	FILE="${1}"
-	DIRECTORY="$(dirname ${1})"
+	if [ "${LH_FORCE}" != "enabled" ]
+	then
+		FILE="${1}"
+		DIRECTORY="$(dirname ${1})"
 
-	# Creating lock directory
-	mkdir -p "${DIRECTORY}"
+		# Creating lock directory
+		mkdir -p "${DIRECTORY}"
 
-	# Creating lock trap
-	trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove; done; exit ${ret}' EXIT
+		# Creating lock trap
+		trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove --force; done; exit ${ret}' EXIT
 
-	# Creating lock file
-	touch "${FILE}"
+		# Creating lock file
+		touch "${FILE}"
+	fi
 }

-- 
debian-live/live-helper



More information about the debian-live-changes mailing list