extract_utils: Detect output existence before moving it for backup

* Avoids:
    Cleaning output directory (./../../../vendor/.../.../proprietary)..
    mv: cannot stat './../../../vendor/.../.../proprietary/*':
    No such file or directory

Change-Id: I3258e64f3997f139d8db4fb4e07d14964a469c78
(cherry picked from commit 3c6bdac74bc212b26f723aa8697099fd636451a8)
This commit is contained in:
Adrian DC 2017-01-15 14:03:26 +01:00 committed by Zhao Wei Liew
parent 80926bd327
commit 2a2b14a051

View File

@ -784,7 +784,9 @@ function extract() {
echo "Cleaning output directory ($OUTPUT_ROOT).."
rm -rf "${OUTPUT_TMP:?}"
mkdir -p "${OUTPUT_TMP:?}"
mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
if [ -d "$OUTPUT_ROOT" ]; then
mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
fi
VENDOR_STATE=1
fi