mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
packaging: Fix clh build from source fall-back
If we fail to download the clh binary, we fall-back to build from source. Unfortunately, `pull_clh_released_binary()` leaves a `cloud_hypervisor` directory behind, which causes `build_clh_from_source()` not to clone the git repo: [ -d "${repo_dir}" ] || git clone "${cloud_hypervisor_repo}" When building from a kata-containers git repo, the subsequent calls to `git` in this function thus apply to the kata-containers repo and eventually fail, e.g.: + git checkout v23.0 error: pathspec 'v23.0' did not match any file(s) known to git It doesn't quite make sense actually to keep an existing directory the content of which is arbitrary when we want to it to contain a specific version of clh. Just remove it instead. Fixes: #4151 Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
5b6e45ed6c
commit
afbd60da27
@ -55,7 +55,8 @@ build_clh_from_source() {
|
||||
info "Build ${cloud_hypervisor_repo} version: ${cloud_hypervisor_version}"
|
||||
repo_dir=$(basename "${cloud_hypervisor_repo}")
|
||||
repo_dir="${repo_dir//.git}"
|
||||
[ -d "${repo_dir}" ] || git clone "${cloud_hypervisor_repo}"
|
||||
rm -rf "${repo_dir}"
|
||||
git clone "${cloud_hypervisor_repo}"
|
||||
pushd "${repo_dir}"
|
||||
|
||||
if [ -n "${cloud_hypervisor_pr}" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user