Explorar el Código

Fix and simplify containerized MC_VERSION parsing

bryan hace 1 día
padre
commit
e2bae2693c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      installJRMC

+ 2 - 2
installJRMC

@@ -421,7 +421,7 @@ get_latest_mc_version() {
     mc_version_source="user input"
   # Containerized package manager
   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_source="containerized package manager"
   # Fallback to webscrape
@@ -1852,7 +1852,7 @@ create_mc_apt_container() {
 			Components: main
 			Architectures: '"$MC_ARCH"'
 		EOF
-    apt-get update --allow-insecure-repositories'
+    apt-get update'
   # If user passes command strings run them in the container
   for cmd in "${cmds[@]}"; do
     sudo buildah run "$CNT" -- sh -c "$cmd"