浏览代码

Fix version checking reliability

bryan 3 年之前
父节点
当前提交
abfb0472e8
共有 1 个文件被更改,包括 2 次插入1 次删除
  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