Mounting container in buildah unshare

This commit is contained in:
2025-11-07 21:52:16 -05:00
parent 71ce48626f
commit 3c7ef14aac

View File

@@ -769,12 +769,17 @@ acquire_deb() {
fi fi
# Download the deb file using the containerized package manager # Download the deb file using the containerized package manager
if ! { create_mc_apt_container "apt-get download --allow-unauthenticated mediacenter$MC_MVERSION &>/dev/null" && # shellcheck disable=SC2016
mnt="$(buildah mount "$CNT")" && if ! { create_mc_apt_container "apt-get download --allow-unauthenticated mediacenter$MC_MVERSION -qq" &&
execute find "$mnt" -maxdepth 1 -type f -name "*.deb" -exec cp {} "$MC_DEB" \; && env CNT="$CNT" MC_DEB="$MC_DEB" buildah unshare -- bash -eu -o pipefail -c '
mnt="$(buildah mount "$CNT")"
deb="$(find "$mnt" -maxdepth 1 -type f -name "*.deb" | head -n1)"
[[ -n "$deb" ]] && cp -f "$deb" "$MC_DEB"
buildah umount "$CNT"
' &&
[[ -f $MC_DEB ]] && [[ -f $MC_DEB ]] &&
execute buildah umount "$CNT" && buildah rm "$CNT";
execute buildah rm "$CNT"; }; then }; then
debug "Failed to download DEB using containerized package manager" debug "Failed to download DEB using containerized package manager"
echo "Using legacy download method" echo "Using legacy download method"
# Define the repository search order # Define the repository search order