X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Fqemu_build.sh;fp=resources%2Flibraries%2Fbash%2Fqemu_build.sh;h=5fbbef809e97f914f98cfe0d750770dea6c9bbd7;hb=ebf71b8ec8863ac82becfcdee97d4e7164fb2fcb;hp=ad6d27b646be24ce4d43afd47aed1f47e4901e87;hpb=fa19644365e53cdf2a02c3c93b1b93a5d3891210;p=csit.git diff --git a/resources/libraries/bash/qemu_build.sh b/resources/libraries/bash/qemu_build.sh index ad6d27b646..5fbbef809e 100755 --- a/resources/libraries/bash/qemu_build.sh +++ b/resources/libraries/bash/qemu_build.sh @@ -56,12 +56,14 @@ else { echo "Qemu already installed: ${QEMU_INSTALL_DIR}"; exit 0; } fi -# Download QEMU source code -wget -P ${WORKING_DIR} -q ${QEMU_PACKAGE_URL} || \ - { echo "Failed to download ${QEMU_VERSION}"; exit 1; } +# Download QEMU source code if no local copy exists +if [ ! -f /opt/${QEMU_DOWNLOAD_PACKAGE} ]; then + wget -P /opt -q ${QEMU_PACKAGE_URL} || \ + { echo "Failed to download ${QEMU_VERSION}"; exit 1; } +fi # Extract archive into temp directory -tar --strip-components 1 -xf ${WORKING_DIR}/${QEMU_DOWNLOAD_PACKAGE} -C ${WORKING_DIR} || \ +tar --strip-components 1 -xf /opt/${QEMU_DOWNLOAD_PACKAGE} -C ${WORKING_DIR} || \ { echo "Failed to extract ${QEMU_VERSION}.tar.xz"; exit 1; } cd ${WORKING_DIR}