diff --git a/create_test.sh b/create_test.sh index f2367cd..588263d 100755 --- a/create_test.sh +++ b/create_test.sh @@ -24,7 +24,7 @@ pkg_dir=$(get_pkg_dir $pkg) configure_main "$session" "$(get_pkg_name $pkg_dir)" -send_src "$pkg_dir" "$session" +send_src_unique "$pkg_dir" "$session" "$@" for p in "$@" do diff --git a/deploy.sh b/deploy.sh index 27bccb7..2688f91 100755 --- a/deploy.sh +++ b/deploy.sh @@ -25,7 +25,7 @@ pkg_dir=$(get_pkg_dir $pkg) configure_pkg_launch "$session" "$pkg_dir" "$launch" -send_src "$pkg_dir" "$session" +send_src_unique "$pkg_dir" "$session" "$@" for p in "$@" do diff --git a/helper.bash b/helper.bash index 51a8ab4..e72ec58 100644 --- a/helper.bash +++ b/helper.bash @@ -128,3 +128,28 @@ function send_src { tar_src $1 > "$t" upload "$2/src" "$t" && rm $t || { rm $t; error "could not upload"; } } + +function test_unique_dir { + local test_dir + local other_dir + test_dir=$(cd "$1"; pwd -P) + shift + for p in "$@" + do + other_dir=$(cd "$p"; pwd -P) + if [[ "$test_dir" == "$other_dir"* ]]; then + return 1 + fi + done + return 0 +} + +function send_src_unique { + local path=$1 + local session=$2 + shift 2 + if test_unique_dir "$path" "$@"; then + send_src "$path" "$session" + fi + return 0 +}