Fix version checking reliability

This commit is contained in:
2021-12-11 10:03:52 -05:00
parent c7a53ac202
commit abfb0472e8

View File

@@ -390,7 +390,8 @@ getLatestVersion() {
"echo 'deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $_base main' > /etc/apt/sources.list 2>&1" "echo 'deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $_base main' > /etc/apt/sources.list 2>&1"
buildah run "$CNT" -- bash -c \ buildah run "$CNT" -- bash -c \
"apt-get update --allow-insecure-repositories -y > /dev/null 2>&1" "apt-get update --allow-insecure-repositories -y > /dev/null 2>&1"
if _mcversion=$(buildah run "$CNT" -- apt-cache policy mediacenter?? | grep Candidate | awk '{print $2}' | sort -V | tail -n1); then if _mcversion=$(buildah run "$CNT" -- apt-cache policy mediacenter?? | grep Candidate | awk '{print $2}' | sort -V | tail -n1) \
&& [[ "$_mcversion" =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
_version_source="containerized package manager" _version_source="containerized package manager"
buildah rm "$CNT" > /dev/null 2>&1 buildah rm "$CNT" > /dev/null 2>&1
return 0 return 0