[X2Go-Commits] buildscripts.git - master (branch) updated: 3014a906a2eb4d6a9488d0f59aa095b8124457e1

X2Go dev team git-admin at x2go.org
Tue Dec 3 21:12:51 CET 2013


The branch, master has been updated
       via  3014a906a2eb4d6a9488d0f59aa095b8124457e1 (commit)
      from  5799b7c7fa70b7c6dc80ba9a22425476ff99f386 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3014a906a2eb4d6a9488d0f59aa095b8124457e1
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Dec 3 21:11:47 2013 +0100

    lock PROJECT_DIR during git sync, needed for parallel builds

-----------------------------------------------------------------------

Summary of changes:
 bin/build-deb-package |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/bin/build-deb-package b/bin/build-deb-package
index 0ab5ee1..445411d 100755
--- a/bin/build-deb-package
+++ b/bin/build-deb-package
@@ -86,6 +86,9 @@ set_vars() {
 	EXTRA_ARCHS="${EXTRA_ARCHS:-}"
 	EXTRA_ARCHS_ONLY="${EXTRA_ARCHS_ONLY:-}"
 
+	# lock file
+	LOCK_FILE=$PROJECT_DIR/../.$PROJECT.lock
+
 	# creating paths
 	mkdir -p "$TEMP_BASE"
 	mkdir -p "$PROJECT_DIR"
@@ -120,7 +123,6 @@ prepare_workspace() {
 	cd "$PROJECT_DIR"
 
 	# by default we build for all current debian versions
-	echo "HIIIIIIEEEEEERR: $ARGV2_CODENAME"
 	if [ "x$ARGV2_CODENAME" != "x" ]; then
 		if echo "$DEBIAN_DISTROS" | grep $ARGV2_CODENAME >/dev/null; then
 			DEB_BUILD_FOR="debian:$ARGV2_CODENAME"
@@ -311,14 +313,34 @@ upload_packages() {
 	return 0
 }
 
+wait_for_lock() {
+	while $LOCK_FILE; do
+		pid=$(head -n1 $LOCK_FILE)
+		if ! ps $pid 1>/dev/null; then rm -f $LOCK_FILE
+		else echo "PROJECT directory is locked, sleeping for 10 secs..."
+		sleep 10
+	done
+}
+
+lock_workspace() {
+	wait_for_lock
+	echo $$ > $LOCK_FILE
+}
+
+unlock_workspace() {
+	rm -f $LOCK_FILE
+}
+
 ### MAIN ###
 set_vars $@ && {
 	if [ "x$(basename $0)" = "x$PREFIX-build-deb-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-deb-package" ]; then
 		cd $PROJECT_DIR && pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" = "yes" ] && {
+			lock_workspace
 			prepare_workspace && {
 				clear_pkgdist
 				build_packages
 			}
+			unlock_workspace
 		}
 	fi
 	if [ "x$(basename $0)" = "x$PREFIX-upload-deb-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-deb-package" ]; then


hooks/post-receive
-- 
buildscripts.git (X2Go packaging scripts)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "buildscripts.git" (X2Go packaging scripts).




More information about the x2go-commits mailing list