Browse Source

Attempting to make variables to represent OS

That is, if $UBUNTU14==1 then the OS is Ubuntu14;
if $UBUNTU12==1 then the OS is Ubuntu12.
msmith-techempower 10 years ago
parent
commit
2f9381643d
3 changed files with 13 additions and 5 deletions
  1. 10 0
      config/benchmark_profile
  2. 1 3
      toolset/setup/linux/database.sh
  3. 2 2
      toolset/setup/linux/frameworks/wt.sh

+ 10 - 0
config/benchmark_profile

@@ -10,6 +10,16 @@ else
 fi
 IROOT=${FWROOT}/installs
 
+# Determine which OS we are using and set the appropriate variables
+source /etc/lsb-release
+UBUNTU12=0
+UBUNTU14=0
+if [[ $DISTRIB_RELEASE == 14.* ]]; then
+  UBUNTU14=1
+elif [[ $DISTRIB_RELEASE == 12.* ]]; then
+  UBUNTU12=1
+fi
+
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=${IROOT}/resin-4.0.41
 export GRAILS_HOME=${IROOT}/grails-2.4.2

+ 1 - 3
toolset/setup/linux/database.sh

@@ -42,8 +42,6 @@ sudo apt-get -y install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=
     redis-server      `# Installs 2.4 or 2.6, based on Ubuntu version` \
     lsb-core          `# Ensure that lsb_release can be used`
 
-CODENAME=$(lsb_release -sc)
-
 sudo sh -c "echo '*               -    nofile          65535' >> /etc/security/limits.conf"
 
 # Create a user-owned directory for our databases
@@ -88,7 +86,7 @@ rm create.sql
 # Postgres
 ##############################
 echo "Setting up Postgres database"
-if [ "$CODENAME" == "precise" ]; then
+if [ $UBUNTU12 -eq 1 ]; then
   echo "WARNING: Force upgrading Postgres for Ubuntu 12.04"
   sudo apt-get remove -y postgresql postgresql-9.1 postgresql-client-9.1
 

+ 2 - 2
toolset/setup/linux/frameworks/wt.sh

@@ -21,9 +21,9 @@ RETCODE=$(fw_exists wt)
 # Instead of compiling from source, just use apt to install onto 
 # host machine
 source /etc/lsb-release
-if [ "$DISTRIB_RELEASE" == "14.04" ]; then
+if [ $UBUNTU14 -eq 1 ]; then
     sudo apt-get -y install libboost1.54-all-dev
-else
+elif [ $UBUNTU12 -eq 1 ]; then
     sudo apt-get -y install libboost1.48-all-dev
 fi