summaryrefslogtreecommitdiff
path: root/tsp/watchers/watcher.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tsp/watchers/watcher.sh')
-rwxr-xr-xtsp/watchers/watcher.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/tsp/watchers/watcher.sh b/tsp/watchers/watcher.sh
index b8b8977..c1fbe29 100755
--- a/tsp/watchers/watcher.sh
+++ b/tsp/watchers/watcher.sh
@@ -20,12 +20,19 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
. "${TSP_DIR}/common.sh"
+trigger_if_not_queued() {
+ LABEL="$1"
+ URL="$2"
+ test -z "$(tspoll | awk -v LABEL="$LABEL" '$2 ~ "queued" && $0 ~ LABEL {print $1}')" &&\
+ tspoll -L "$LABEL" sh "${TSP_DIR}/jobs/trigger_downloads.sh" "$URL" "$3"
+}
+
# Dispatch tsp/jobs/trigger_downloads.sh for common snapshot and prerelease urls
-tspoll -L 4_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/common/" tizen_4.0_snapshot
-tspoll -L 4_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/common/" tizen_4.0_prerelease
-tspoll -L 3_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/3.0-common/" tizen_3.0_snapshot
-tspoll -L 3_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/3.0-common/" tizen_3.0_prerelease
-tspoll -L UNI_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/unified/" tizen_uni_snapshot
-tspoll -L UNI_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/unified/" tizen_uni_prerelease
-tspoll -L UNI4_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/4.0-unified/" tizen_4.0_uni_snapshot
-tspoll -L UNI4_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/4.0-unified/" tizen_4.0_uni_prerelease
+trigger_if_not_queued 4_SNAPSHOT "http://download.tizen.org/snapshots/tizen/common/" tizen_4.0_snapshot
+trigger_if_not_queued 4_PRERELEASE "http://download.tizen.org/prerelease/tizen/common/" tizen_4.0_prerelease
+trigger_if_not_queued 3_SNAPSHOT "http://download.tizen.org/snapshots/tizen/3.0-common/" tizen_3.0_snapshot
+trigger_if_not_queued 3_PRERELEASE "http://download.tizen.org/prerelease/tizen/3.0-common/" tizen_3.0_prerelease
+trigger_if_not_queued UNI_SNAPSHOT "http://download.tizen.org/snapshots/tizen/unified/" tizen_uni_snapshot
+trigger_if_not_queued UNI_PRERELEASE "http://download.tizen.org/prerelease/tizen/unified/" tizen_uni_prerelease
+trigger_if_not_queued UNI4_SNAPSHOT "http://download.tizen.org/snapshots/tizen/4.0-unified/" tizen_4.0_uni_snapshot
+trigger_if_not_queued UNI4_PRERELEASE "http://download.tizen.org/prerelease/tizen/4.0-unified/" tizen_4.0_uni_prerelease