remove Redhat support while introducing Scientific Linux
authorS.Çağlar Onur <caglar@verivue.com>
Tue, 8 Mar 2011 22:30:53 +0000 (17:30 -0500)
committerS.Çağlar Onur <caglar@verivue.com>
Tue, 8 Mar 2011 22:30:53 +0000 (17:30 -0500)
build.common

index 1edfdea..69a4697 100644 (file)
@@ -18,7 +18,7 @@ export PATH=.:$PATH
 function pl_getDistro() {
     if [ -f "/etc/redhat-release" ] ; then
        distro=$(awk ' { print $1 } ' /etc/redhat-release)
-       case $distro in Red*) distro="Redhat" ; esac
+       case $distro in Scientific*) distro="SL" ; esac
     else
        echo "build.common.pl_getDistro-unknown"
        exit 1
@@ -30,7 +30,7 @@ function pl_getDistro() {
 # returns something like 8, 10, or 5.3
 function pl_getRelease() {
     if [ -f "/etc/redhat-release" ] ; then
-       release=$(awk ' { if ($1=="Fedora" && $2=="Core") print $4 ; if (($1=="Fedora" && $2!="Core")||$1=="CentOS") print $3 ; if ($1=="Red") print $6 } ' /etc/redhat-release)
+       release=$(awk ' { if ($1=="Fedora" && $2=="Core") print $4 ; if (($1=="Fedora" && $2!="Core")||$1=="CentOS") print $3 ; if ($1=="Scientific") print $4 } ' /etc/redhat-release)
     else
        echo "build.common.pl_getRelease-unknown"
        exit 1
@@ -48,9 +48,6 @@ function pl_getReleaseName () {
        [Ff]edora*)
            releasename=f$release
            ;;
-       [Re]edhat*)
-           releasename=rhel6
-           ;;
        [Cc]entOS*)
            old_IFS="$IFS"
            IFS="."
@@ -58,6 +55,9 @@ function pl_getReleaseName () {
            IFS="$old_IFS"
            releasename=centos$1
            ;;
+       [Ss]cientific*)
+           releasename=sl$release
+           ;;
        *)
            releasename="unknown-name-for-${pl_DISTRO}-please-edit-build.common"
            echo 1>&2 "build.common: WARNING - releasename not set for distro=$distro"