mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 13:44:33 +00:00
ci/install_libseccomp: use a temporary work directory
It is safer to download the tarballs and work on a temporary directory which can be proper cleaned up when the script finishes. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
parent
98b4406196
commit
9b270d72d1
@ -20,6 +20,7 @@ source "${tests_repo_dir}/.ci/lib.sh"
|
|||||||
unset PREFIX DESTDIR
|
unset PREFIX DESTDIR
|
||||||
|
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
|
workdir="$(mktemp -d --tmpdir build-libseccomp.XXXXX)"
|
||||||
|
|
||||||
# Variables for libseccomp
|
# Variables for libseccomp
|
||||||
# Currently, specify the libseccomp version directly without using `versions.yaml`
|
# Currently, specify the libseccomp version directly without using `versions.yaml`
|
||||||
@ -58,7 +59,7 @@ die() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
rm -rf "${libseccomp_tarball}" "libseccomp-${libseccomp_version}" "${gperf_tarball}" "gperf-${gperf_version}"
|
rm -rf "${workdir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap finish EXIT
|
trap finish EXIT
|
||||||
@ -98,9 +99,11 @@ main() {
|
|||||||
die "Usage: ${0} <libseccomp-install-dir> <gperf-install-dir>"
|
die "Usage: ${0} <libseccomp-install-dir> <gperf-install-dir>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pushd "$workdir"
|
||||||
# gperf is required for building the libseccomp.
|
# gperf is required for building the libseccomp.
|
||||||
build_and_install_gperf
|
build_and_install_gperf
|
||||||
build_and_install_libseccomp
|
build_and_install_libseccomp
|
||||||
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user