Change directories structure on device
authorDmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Thu, 3 Aug 2017 11:42:55 +0000 (14:42 +0300)
committerMaria Guseva <m.guseva@samsung.com>
Mon, 14 Aug 2017 16:52:21 +0000 (19:52 +0300)
Now it will be like this:
$ infra/built_targets.sh publish <target> <dest>

Directories tree:
 <dest>/
  ` -- <target>/
        | -- fuzzer1/
        |    ` -- fuzzer1
        | -- fuzzer2/
        |    ` -- fuzzer2
        . . .

infra/commands/publish.sh

index 64683fc..6dfed24 100755 (executable)
@@ -62,7 +62,7 @@ fi
 ########################################################
 
 target_name="${1}"
-destination="${2}"
+destination="${2}/${1}"
 
 # find specified target
 TARGET_DIR="${BUILD_ARTIFACTS_DIR}/${target_name}"
@@ -124,16 +124,16 @@ for sanitized_rpm in $(find "${TARGET_DIR}/${ARCH}/rpm" -name "*.rpm" \
     sdb_shell rm -f "${rpm_path}"
 done
 
-# push targets
-printf "\nPushing fuzzing targets to device...\n"
-
+# turn off root mode if required
 if (( ROOT != 1 )); then
     ${SDB_CMD} root off >/dev/null
 fi
 
-sdb_shell mkdir -p "${destination}"
+# push targets
+printf "\nPushing fuzzing targets to device...\n"
+
 for target_bin in $(find "${TARGET_DIR}/${ARCH}/target" -type f); do
     echo "${target_bin}"
-
-    ${SDB_CMD} push "${target_bin}" "${destination}" >/dev/null
+    sdb_shell_wrap mkdir -p "${destination}/${target_bin}"
+    ${SDB_CMD} push "${target_bin}" "${destination}/${target_bin}/" >/dev/null
 done