Clean all previously published targets in the 'publish' command 03/158403/4
authorDmitriy Nikiforov <d.nikiforov@samsung.com>
Tue, 31 Oct 2017 16:44:46 +0000 (19:44 +0300)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 7 Nov 2017 12:33:58 +0000 (12:33 +0000)
This should save us a lot of space on device.

Change-Id: I42e47c223cb6c07c8c46ccbda844a167bc20a235

infra/commands/publish.sh

index 2bdd2af..f179473 100755 (executable)
@@ -98,6 +98,10 @@ if [[ -z ${ARCH} || ! -d ${PROJECT_DIR}/${ARCH} ]]; then
     exit 1
 fi
 
+# clean previous artifacts
+printf "\nCleaning artifacts from previous builds..."
+sdb_shell rm -rf "${FUZZING_DIR}" '||' ':'
+
 # check and install, if needed, necessary dependencies
 printf "\nChecking dependencies...\n"
 check_and_install_deps "${INSTALL_DEPS}" 'base' 'cpio'
@@ -164,7 +168,6 @@ done
 printf "\nPushing dictionaries to device...\n"
 
 dict_dir="${PROJECT_DEST_DIR}/dicts"
-sdb_shell rm -rf "${dict_dir}" '||' true
 sdb_shell mkdir -p "${dict_dir}"
 if [[ -d ${PROJECT_DIR}/dicts ]]; then
     echo "sdb push ${PROJECT_DIR}/dicts ${dict_dir}"
@@ -190,7 +193,6 @@ for target in "${targets[@]}"; do
     target_name=$(basename "${target}")
     seed_corpus_zip=$(find "${CORPUS_DIR}" -name "${target_name}.zip" -print -quit 2>/dev/null || true)
     if [[ -n ${CORPUS_DIR} && -f ${seed_corpus_zip} ]]; then
-        sdb_shell rm -f "${seed_corpus_dir}/*" '||' true
         echo "sdb push ${seed_corpus_zip} ${seed_corpus_dir}"
         ${SDB_CMD} push "${seed_corpus_zip}" "${seed_corpus_dir}" >/dev/null