From: Michael Tremer Date: Sat, 7 Feb 2009 14:47:07 +0000 (+0100) Subject: Improved detection if buildspy is already running. X-Git-Tag: v3.0-alpha1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4b2e100a35cb877327e38260fc5f7842523d9ed;p=ipfire-3.x.git Improved detection if buildspy is already running. Added some commands to run buildspy manually. --- diff --git a/tools/make-buildspy b/tools/make-buildspy index 7ae3591d7..41d0f0aac 100755 --- a/tools/make-buildspy +++ b/tools/make-buildspy @@ -20,6 +20,7 @@ ############################################################################### BUILD_SPY_FILENAME=$BASEDIR/.build_spy +BUILD_SPY_PID=$BUILD_SPY_FILENAME.pid build_spy() { local COMMAND @@ -48,10 +49,11 @@ build_spy_send_profile() { } if [ "$(basename $0)" == "make-buildspy" ]; then - if ps aux | grep -q [m]ake-buildspy; then - # Build spy is already running. Exiting silently. + if [ -f "$BUILD_SPY_PID" ]; then exit 0 fi + echo $$ > $BUILD_SPY_PID + while true; do DATA+=$(cat $BUILD_SPY_FILENAME 2>/dev/null || true) > $BUILD_SPY_FILENAME @@ -77,5 +79,5 @@ if [ "$(basename $0)" == "make-buildspy" ]; then sleep 10 done - rm -f $BUILD_SPY_FILENAME + rm -f $BUILD_SPY_FILENAME $BUILD_SPY_PID fi diff --git a/tools/make-interactive b/tools/make-interactive index 2ceb64468..1fff16e5d 100644 --- a/tools/make-interactive +++ b/tools/make-interactive @@ -65,6 +65,21 @@ batch) esac ;; +buildspy|bs) + # control buildspy + case "$2" in + start) + build_spy start + ;; + stop) + build_spy exit + ;; + *) + usage + ;; + esac + ;; + ccache) # ccache options case "$2" in