snap: Remove QEMU before clone

If you snap in an environment where you previously snapped,
`git clone`ing QEMU will fail. Remove the checkout directory.

Fixes: #2249
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke 2021-07-15 12:22:21 +02:00
parent 594ff3a5bd
commit 558f1be62d
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE

View File

@ -270,6 +270,7 @@ parts:
# download source
qemu_dir=${SNAPCRAFT_STAGE}/qemu
rm -rf "${qemu_dir}"
git clone --branch ${branch} --single-branch ${url} "${qemu_dir}"
cd ${qemu_dir}
[ -z "${commit}" ] || git checkout ${commit}