The archive scripts has a bug that causes it to spam "File exists" at
the end of a log. This patch improves the script to handle this a little
better.
Change-Id: I61e939e74d7ab9c5f87a83cebd96ce886927bc88
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
mkdir -p "$ARCHIVES_DIR"
mkdir -p "$WORKSPACE/archives"
-if [ ! -z "${ARCHIVE_ARTIFACTS}" ]; then
+if [ ! -z "$ARCHIVE_ARTIFACTS" ]; then
pushd "$WORKSPACE"
shopt -s globstar # Enable globstar to copy archives
for f in $ARCHIVE_ARTIFACTS; do
+ [[ -e $f ]] || continue # handle the case of no files to archive
echo "Archiving $f"
- mkdir -p "$WORKSPACE/archives/$(dirname "$f")"
+ dir=$(dirname "$f")
+ mkdir -p "$WORKSPACE/archives/$dir"
mv "$f" "$WORKSPACE/archives/$f"
done
shopt -u globstar # Disable globstar once archives are copied