aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2017-07-19 07:21:49 +0000
committerPeter Mikus <pmikus@cisco.com>2017-07-19 09:23:50 +0000
commitfb05d6559d8239cf7f43e8541e226f486ed1d5e8 (patch)
tree50683e30f58ceef21c3421c087fd6c33208d3fc3
parentee3c73c50b76436a2423603bc8454450f15af506 (diff)
FIX: Do not download Qemu multiple times per job
- Add caching of Qemu source code to avoid downloading multiple times. Change-Id: Ie06dd87a08c38ca27fbe9844f25f11b8df1ff2e2 Signed-off-by: Peter Mikus <pmikus@cisco.com> (cherry picked from commit ebf71b8ec8863ac82becfcdee97d4e7164fb2fcb)
-rwxr-xr-xresources/libraries/bash/qemu_build.sh10
1 files changed, 6 insertions, 4 deletions
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}