sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] BZR Change 21 to stage-root sorcery by David Brown <dmlb2000@dmlb2004>
- From: bzr AT mail.sourcemage.org
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] BZR Change 21 to stage-root sorcery by David Brown <dmlb2000@dmlb2004>
- Date: Fri, 14 Apr 2006 15:40:03 -0500
------------------------------------------------------------
revno: 21
committer: David Brown <dmlb2000@dmlb2004>
branch nick: stage-root
timestamp: Fri 2006-04-14 13:33:24 -0700
message:
updated to prevent race condition by serializing the rm -rf's of the deaddir
=== modified file 'var/lib/sorcery/modules/libgrimoire'
--- var/lib/sorcery/modules/libgrimoire
+++ var/lib/sorcery/modules/libgrimoire
@@ -80,9 +80,14 @@
# a) $DEAD_DIR being an empty string
# b) $DEAD_DIR being set to "/" (or anything above /usr/src)
# c) $DEAD_DIR containing metacharacters (like newline)
- local ddate=$(date +%Y%m%d%H%M%S%N)
- mv "$DEAD_DIR" "$INSTALL_ROOT/usr/src/deaddir-$ddate" &&
- (rm -rf "$INSTALL_ROOT/usr/src/deaddir-$ddate" 2> /dev/null)
&
+
+ # prevent race condition by serializing on deaddir
+ while ! mkdir "$BUILD_DIRECTORY/deaddir" 2> /dev/null
+ do
+ sleep 1
+ done &&
+ mv "$DEAD_DIR" "$INSTALL_ROOT/usr/src/deaddir" &&
+ (rm -rf "$INSTALL_ROOT/usr/src/deaddir" 2> /dev/null) &
popd 2>&1 > /dev/null
true
- [SM-Commit] BZR Change 21 to stage-root sorcery by David Brown <dmlb2000@dmlb2004>, bzr, 04/14/2006
Archive powered by MHonArc 2.6.24.