Fix and simplify containerized MC_VERSION parsing
This commit is contained in:
@@ -421,7 +421,7 @@ get_latest_mc_version() {
|
|||||||
mc_version_source="user input"
|
mc_version_source="user input"
|
||||||
# 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%%.*}}" | grep Candidate | awk '{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) &&
|
||||||
[[ $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
|
||||||
@@ -1852,7 +1852,7 @@ create_mc_apt_container() {
|
|||||||
Components: main
|
Components: main
|
||||||
Architectures: '"$MC_ARCH"'
|
Architectures: '"$MC_ARCH"'
|
||||||
EOF
|
EOF
|
||||||
apt-get update --allow-insecure-repositories'
|
apt-get update'
|
||||||
# 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"
|
||||||
|
|||||||
Reference in New Issue
Block a user