Explorar o código

Fix version checking reliability

bryan %!s(int64=3) %!d(string=hai) anos
pai
achega
abfb0472e8
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      installJRMC

+ 2 - 1
installJRMC

@@ -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"
         buildah run "$CNT" -- bash  -c \
             "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"
             buildah rm "$CNT" > /dev/null 2>&1
             return 0