Browse Source

Merge pull request #8251 from xwang2713/HPCC_14934-support-amazon-linux

HPCC-14934  Add code to detect amazon linux

Reviewed-By: Michael Gardner <michael.gardner@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 years ago
parent
commit
48cd4093cc
2 changed files with 20 additions and 0 deletions
  1. 6 0
      cmake_modules/distrocheck.sh
  2. 14 0
      cmake_modules/getpackagerevisionarch.sh

+ 6 - 0
cmake_modules/distrocheck.sh

@@ -26,6 +26,12 @@ elif [ -e /etc/redhat-release ]; then
 elif [ -e /etc/SuSE-release ]; then
     echo -n "RPM"
     exit 1;
+elif [ -e /etc/system-release ]; then
+    grep -q -i "Amazon Linux" /etc/system-release
+    if [ $? = 0 ]; then
+        echo -n "RPM"
+        exit 1;
+    fi
 fi
 
 cat /etc/*release > temp.txt

+ 14 - 0
cmake_modules/getpackagerevisionarch.sh

@@ -105,6 +105,20 @@ elif [ -e /etc/SuSE-release ]; then
           ;;
       esac
   fi
+elif [ -e /etc/system-release ]; then
+  if [ -x /bin/rpm ]; then
+      OS_GROUP=$(grep -i "Linux" /etc/system-release | awk '{ print  $1}')
+      case "$OS_GROUP" in
+        "Amazon" )
+          if [ ${NOARCH} -eq 0 ]; then
+              OUTPUT="amzn1.${ARCH}"
+          else
+              OUTPUT="amzn1"
+          fi
+          ;;
+
+      esac
+  fi
 elif [ -e /etc/gentoo-release ]; then
   OUTPUT="gentoo"
 else