Browse code

Match RHEL Beta release strings

RHEL7 (in beta) has "Beta" after the release number and before the
code-name. Add a number-match to the regex so everything between that
match and the codename in parenthesis is considered the release.

Change-Id: I992f20eedcefc6aeed6bd3ad57fc4cf20c8ef15d

Ian Wienand authored on 2013/12/17 14:26:21
Showing 1 changed files
... ...
@@ -422,6 +422,7 @@ GetOSVersion() {
422 422
         os_CODENAME=$(lsb_release -c -s)
423 423
     elif [[ -r /etc/redhat-release ]]; then
424 424
         # Red Hat Enterprise Linux Server release 5.5 (Tikanga)
425
+        # Red Hat Enterprise Linux Server release 7.0 Beta (Maipo)
425 426
         # CentOS release 5.5 (Final)
426 427
         # CentOS Linux release 6.0 (Final)
427 428
         # Fedora release 16 (Verne)
... ...
@@ -430,7 +431,7 @@ GetOSVersion() {
430 430
         for r in "Red Hat" CentOS Fedora XenServer; do
431 431
             os_VENDOR=$r
432 432
             if [[ -n "`grep \"$r\" /etc/redhat-release`" ]]; then
433
-                ver=`sed -e 's/^.* \(.*\) (\(.*\)).*$/\1\|\2/' /etc/redhat-release`
433
+                ver=`sed -e 's/^.* \([0-9].*\) (\(.*\)).*$/\1\|\2/' /etc/redhat-release`
434 434
                 os_CODENAME=${ver#*|}
435 435
                 os_RELEASE=${ver%|*}
436 436
                 os_UPDATE=${os_RELEASE##*.}