浏览代码

Switch to using only the RPM command to determine the distro version.

Signed-off-by: Avi Miller <avi.miller@oracle.com>
Avi Miller 10 年之前
父节点
当前提交
a43199f143
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      hack/install.sh

+ 2 - 2
hack/install.sh

@@ -140,12 +140,12 @@ do_install() {
 	fi
 	if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then
 		lsb_dist='fedora'
-		dist_version="$(rpm -qa \*-release | cut -d"-" -f3 | head -n1)"
+		dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION\n")"
 	fi
 	if [ -z "$lsb_dist" ]; then
 		if [ -r /etc/centos-release ] || [ -r /etc/redhat-release ]; then
 			lsb_dist='centos'
-			dist_version="$(rpm -qa \*-release | cut -d"-" -f3 | head -n1)"
+			dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION}\n")"
 		fi
 	fi
 	if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then