From 58913694d36e6bf5b8ae323bec85ba0d05558b5f Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 1 Mar 2022 17:31:08 +0000 Subject: [PATCH] snap: Use git clone depth 1 for QEMU and dependencies Use `git clone --depth 1 ...` for QEMU and its dependencies to speed up checkouts. Fixes: #3799. Signed-off-by: James O. D. Hunt --- snap/snapcraft.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 173c0f7b73..2e36c25bb3 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -264,12 +264,12 @@ parts: # download source qemu_dir=${SNAPCRAFT_STAGE}/qemu rm -rf "${qemu_dir}" - git clone --branch ${branch} --single-branch ${url} "${qemu_dir}" + git clone --depth 1 --branch ${branch} --single-branch ${url} "${qemu_dir}" cd ${qemu_dir} [ -z "${commit}" ] || git checkout ${commit} - [ -n "$(ls -A ui/keycodemapdb)" ] || git clone https://github.com/qemu/keycodemapdb ui/keycodemapdb/ - [ -n "$(ls -A capstone)" ] || git clone https://github.com/qemu/capstone capstone + [ -n "$(ls -A ui/keycodemapdb)" ] || git clone --depth 1 https://github.com/qemu/keycodemapdb ui/keycodemapdb/ + [ -n "$(ls -A capstone)" ] || git clone --depth 1 https://github.com/qemu/capstone capstone # Apply branch patches [ -d "${patches_version_dir}" ] || mkdir "${patches_version_dir}"