Rechain container commands

This commit is contained in:
2025-04-25 00:25:41 -04:00
parent e2bae2693c
commit b4bdacccdf

View File

@@ -422,6 +422,7 @@ get_latest_mc_version() {
# Containerized package manager # Containerized package manager
elif create_mc_apt_container && elif create_mc_apt_container &&
MC_VERSION=$(sudo buildah run "$CNT" -- apt-cache policy "mediacenter${USER_MC_MVERSION:-${MC_VERSION%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) && MC_VERSION=$(sudo buildah run "$CNT" -- apt-cache policy "mediacenter${USER_MC_MVERSION:-${MC_VERSION%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) &&
execute sudo buildah rm "$CNT" &&
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then [[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
mc_version_source="containerized package manager" mc_version_source="containerized package manager"
# Fallback to webscrape # Fallback to webscrape
@@ -1842,8 +1843,8 @@ create_mc_apt_container() {
{ command -v buildah &>/dev/null || install_package buildah &>/dev/null; } && { command -v buildah &>/dev/null || install_package buildah &>/dev/null; } &&
CNT=$(sudo buildah from --quiet alpine:edge) && CNT=$(sudo buildah from --quiet alpine:edge) &&
sudo buildah run "$CNT" -- sh -c ' sudo buildah run "$CNT" -- sh -c '
apk add --no-cache apt curl gnupg apk add --no-cache apt curl gnupg &>/dev/null &&
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg &>/dev/null &&
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
Types: deb Types: deb
URIs: https://dist.jriver.com/latest/mediacenter/ URIs: https://dist.jriver.com/latest/mediacenter/
@@ -1851,8 +1852,8 @@ create_mc_apt_container() {
Suites: '"$MC_REPO"' Suites: '"$MC_REPO"'
Components: main Components: main
Architectures: '"$MC_ARCH"' Architectures: '"$MC_ARCH"'
EOF EOF &&
apt-get update' apt-get update &>/dev/null' &&
# If user passes command strings run them in the container # If user passes command strings run them in the container
for cmd in "${cmds[@]}"; do for cmd in "${cmds[@]}"; do
sudo buildah run "$CNT" -- sh -c "$cmd" sudo buildah run "$CNT" -- sh -c "$cmd"