]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/trigger-wrapper
commit uncommited changes
[wannabuild.git] / bin / trigger-wrapper
index 5208c22072b4a896e5ecfe06b4e4c775edb92cac..c3772da42f18cbc16e84db2c8f2880511f0d3ee1 100755 (executable)
@@ -8,16 +8,25 @@ set -- $SSH_ORIGINAL_COMMAND
 
 shift
 args="$*"
+args=${args//[^a-zA-Z-]/}
+args=${args,,}
+
+# Ignore ftpsync stuff.
+if [ "$args" = "syncall" -o "$args" = "sync:all" ]
+then
+    args=""
+fi
 
 echo "$(date): $trigger_name | $args" >> /org/wanna-build/db/signal.log
 
 if [ ! -z "$args" ]
 then
-    # Append because we might get triggered for multiple suites.
-    # (This is mainly for security currently.)
-    echo $args >> /org/wanna-build/signals/$trigger_name
+    # Pass arguments in the filename because we might get triggered for
+    # multiple suites.  A simple append wouldn't be race-free on the
+    # reader side.
+    touch "/org/wanna-build/signals/${trigger_name}.${args}"
 else
-    touch /org/wanna-build/signals/$trigger_name
+    touch "/org/wanna-build/signals/$trigger_name"
 fi
 
 exit 0