[Pm-utils] [PATCH 5/6] Run all non-core hooks in the background.

Victor Lowther victor.lowther at gmail.com
Sun May 11 18:44:01 PDT 2008


---
 pm/pm-functions.in |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index d99809d..b101f97 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -193,9 +193,17 @@ run_some_hooks()
 		continue
 	    fi
 	    log -n "${hook} $@: "
-	    hook_ok "$hook" && "${hook}" "$@"
-	    hook_exit_status $?
+	    hook_ok "$hook" && {
+		if [ "$hook_coa" = "core" ]; then
+		    "${hook}" "$@"
+		    hook_exit_status $?
+		else
+		    "${hook}" "$@" &
+		    echo "running in background."
+		fi
+	    }
 	done
+	[ "$hook_coa" = "core" ] || wait
 }
 	    
 # Run all applicable hooks, logging success and failure as we go.
-- 
1.5.4.3



More information about the Pm-utils mailing list