# HG changeset patch # User wenzelm # Date 1308853848 -7200 # Node ID 6eec653d55993f81f030fc83aed474644c4fc2ee # Parent d6791dc3534d204979c883d3b14b35d7c6f50ff8 more robust concurrent builds; diff -r d6791dc3534d -r 6eec653d5599 lib/scripts/java_ext_dirs --- a/lib/scripts/java_ext_dirs Thu Jun 23 10:08:35 2011 -0700 +++ b/lib/scripts/java_ext_dirs Thu Jun 23 20:30:48 2011 +0200 @@ -24,10 +24,14 @@ mkdir -p "$TARGET_DIR" || fail "Bad directory: \"$TARGET_DIR\"" pushd "$TARGET_DIR" >/dev/null - rm -rf classes && mkdir classes - javac -d classes -source 1.5 "$(jvmpath "$SOURCE")" || fail "Failed to compile sources" - jar cf "$(jvmpath "$TARGET")" -C classes . || fail "Failed to produce $TARGET" - rm -rf classes + BUILD="build$$" + TMP_JAR="java_ext_dirs$$.jar" + + rm -rf "$BUILD" && mkdir "$BUILD" + javac -d "$BUILD" -source 1.5 "$(jvmpath "$SOURCE")" || fail "Failed to compile sources" + jar cf "$TMP_JAR" -C "$BUILD" . || fail "Failed to produce $TMP_JAR" + mv "$TMP_JAR" "$TARGET" + rm -rf "$BUILD" popd >/dev/null fi