From c44781c321f66da5474bbd225c85eef8d877479f Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:04:57 -0400 Subject: [PATCH 01/11] Extracted package specific configuration from install.conf into package specific conf files. --- conf/default/boost.conf.default | 43 +++++++++++++ conf/default/bullet.conf.default | 44 +++++++++++++ conf/default/install.conf.default | 102 ++++++------------------------ conf/default/jsoncpp.conf.default | 42 ++++++++++++ 4 files changed, 149 insertions(+), 82 deletions(-) create mode 100644 conf/default/boost.conf.default create mode 100644 conf/default/bullet.conf.default create mode 100644 conf/default/jsoncpp.conf.default diff --git a/conf/default/boost.conf.default b/conf/default/boost.conf.default new file mode 100644 index 000000000..599027bb8 --- /dev/null +++ b/conf/default/boost.conf.default @@ -0,0 +1,43 @@ +#!/bin/bash + +# Copyright © 2012, United States Government, as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All rights reserved. +# +# The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed +# under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +# Purpose: Define configuration directives for setup_boost.sh. +# Date: 2014-08-18 +# Usage: Copy/rename this file to '../boost.conf' and run setup.sh + +# @see scripts/setup_boost.sh for more info + +# Boost installation prefix +# Global install: /usr/local (default), env install: "$ENV_DIR" +# If you've already installed the package under this prefix, this is the +# only thing you'll need to set. +BOOST_INSTALL_PREFIX="$INSTALL_PREFIX" + +# Location where bullet is to be built if necessary, or where it was built if +# you're using an existing package. This doesn't need to be set unless boost is +# not already installed. +BOOST_BUILD_DIR="$env_dir/build/boost_1_53_0" + +# This is the location where you unzipped the package (or, where it will +# be unzipped if necessary). +BOOST_PACKAGE_DIR="$BOOST_BUILD_DIR" + +# BOOST_URL can be either a web address or a local file address, +# e.g. http://url.com/for/boost.tgz or file:///path/to/boost.tgz +BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz" + diff --git a/conf/default/bullet.conf.default b/conf/default/bullet.conf.default new file mode 100644 index 000000000..6d40b2638 --- /dev/null +++ b/conf/default/bullet.conf.default @@ -0,0 +1,44 @@ +#!/bin/bash + +# Copyright © 2012, United States Government, as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All rights reserved. +# +# The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed +# under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +# Purpose: Define configuration directives for setup_bullet.sh. +# Date: 2014-08-18 +# Usage: Copy/rename this file to '../bullet.conf' and run setup.sh + +# @see scripts/setup_bullet.sh for more info. + +# Bullet installation prefix +# Global install: /usr/local, env install: "$env_dir" +# By default, setup will download and install bullet under your env directory. +# If you have an existing bullet install, you should change +# BULLET_INSTALL_PREFIX to what was used for installation (likely /usr/local). +BULLET_INSTALL_PREFIX="$env_dir" + +# Location where bullet is to be built, or where it was built if you're using +# an existing package. +BULLET_BUILD_DIR="$env_dir/build/bullet-2.82-r2704" + +# This is the location where you unzipped the package (or, where it will be +# unzipped if required). This will be the same as the build dir unless you did +# an out-of-source build (not common for bullet). +BULLET_PACKAGE_DIR="$BULLET_BUILD_DIR" + +# BULLET_URL can be either a web address or a local file address, +# e.g. 'http://url.com/for/bullet.tgz' or 'file:///path/to/bullet.tgz' +BULLET_URL="http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz" + diff --git a/conf/default/install.conf.default b/conf/default/install.conf.default index d8464aa7c..d6c74a0d3 100644 --- a/conf/default/install.conf.default +++ b/conf/default/install.conf.default @@ -1,8 +1,24 @@ -#!/bin/sh -# Purpose: Define configuration directives for setup.sh. -# Date: 2013-04-29 -# Usage: Copy/rename this file to '../install.conf' and run setup.sh +#!/bin/bash +# Copyright © 2012, United States Government, as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All rights reserved. +# +# The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed +# under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +# Purpose: Define configuration directives for setup +# Date: 2014-08-18 +# Usage: Copy/rename this file to '../install.conf' and run setup.sh ############################################# # Script Initialization -- do not edit. @@ -17,7 +33,6 @@ bin_dir="$env_dir/bin" build_dir="$env_dir/build" ############################################# - ############################################# # Configuration -- edit below as needed. ############################################# @@ -30,80 +45,3 @@ build_dir="$env_dir/build" # IMPORTANT: If you've previously installed to /usr/local, you'll need to # delete your 'env' directory before running setup again. INSTALL_PREFIX="$env_dir" - - -# -# Bullet Physics -# - -# @see scripts/setup_bullet.sh for more info. - -# Bullet installation prefix -# Global install: /usr/local, env install: "$env_dir" -# By default, setup will download and install bullet under your env directory. -# If you have an existing bullet install, you should change -# BULLET_INSTALL_PREFIX to what was used for installation (likely /usr/local). -BULLET_INSTALL_PREFIX="$env_dir" - -# Location where bullet is to be built, or where it was built if you're using -# an existing package. -BULLET_BUILD_DIR="$env_dir/build/bullet-2.82-r2704" - -# This is the location where you unzipped the package (or, where it will be -# unzipped if required). This will be the same as the build dir unless you did -# an out-of-source build (not common for bullet). -BULLET_PACKAGE_DIR="$BULLET_BUILD_DIR" - -# BULLET_URL can be either a web address or a local file address, -# e.g. 'http://url.com/for/bullet.tgz' or 'file:///path/to/bullet.tgz' -BULLET_URL="http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz" - -# -# Boost -# - -# @see scripts/setup_boost.sh for more info - -# Boost installation prefix -# Global install: /usr/local (default), env install: "$ENV_DIR" -# If you've already installed the package under this prefix, this is the -# only thing you'll need to set. -BOOST_INSTALL_PREFIX="$INSTALL_PREFIX" - -# Location where bullet is to be built if necessary, or where it was built if -# you're using an existing package. This doesn't need to be set unless boost is -# not already installed. -BOOST_BUILD_DIR="$env_dir/build/boost_1_53_0" - -# This is the location where you unzipped the package (or, where it will -# be unzipped if necessary). -BOOST_PACKAGE_DIR="$BOOST_BUILD_DIR" - -# BOOST_URL can be either a web address or a local file address, -# e.g. http://url.com/for/boost.tgz or file:///path/to/boost.tgz -BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz" - -# -# jsoncpp -# - -# @see scripts/setup_jsoncpp.sh for more info - -# jsoncpp installation prefix -# Global install: /usr/local (default), env install: "$ENV_DIR" -# If you've already installed the package under this prefix, this is the -# only thing you'll need to set. -JSONCPP_INSTALL_PREFIX="$env_dir" - -# Location where jsoncpp is to be built if necessary, or where it was built if -# you're using an existing package. This doesn't need to be set unless jsoncpp is -# not already installed. -JSONCPP_BUILD_DIR="$env_dir/build/jsoncpp" - -# This is the location where you unzipped the package (or, where it will -# be unzipped if necessary). -JSONCPP_PACKAGE_DIR="$JSONCPP_BUILD_DIR" - -# JSONCPP_URL can be either a web address or a local file address, -# e.g. http://url.com/for/jsoncpp.tgz or file:///path/to/jsoncpp.tgz -JSONCPP_URL="https://github.com/open-source-parsers/jsoncpp/archive/3515db184a836ce73b99c064bcc83884570657c2.tar.gz" diff --git a/conf/default/jsoncpp.conf.default b/conf/default/jsoncpp.conf.default new file mode 100644 index 000000000..20e91a9e9 --- /dev/null +++ b/conf/default/jsoncpp.conf.default @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copyright © 2012, United States Government, as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All rights reserved. +# +# The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed +# under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +# Purpose: Define configuration directives for setup_bullet.sh. +# Date: 2014-08-18 +# Usage: Copy/rename this file to '../bullet.conf' and run setup.sh + +# @see scripts/setup_jsoncpp.sh for more info + +# jsoncpp installation prefix +# Global install: /usr/local (default), env install: "$ENV_DIR" +# If you've already installed the package under this prefix, this is the +# only thing you'll need to set. +JSONCPP_INSTALL_PREFIX="$env_dir" + +# Location where jsoncpp is to be built if necessary, or where it was built if +# you're using an existing package. This doesn't need to be set unless jsoncpp is +# not already installed. +JSONCPP_BUILD_DIR="$env_dir/build/jsoncpp" + +# This is the location where you unzipped the package (or, where it will +# be unzipped if necessary). +JSONCPP_PACKAGE_DIR="$JSONCPP_BUILD_DIR" + +# JSONCPP_URL can be either a web address or a local file address, +# e.g. http://url.com/for/jsoncpp.tgz or file:///path/to/jsoncpp.tgz +JSONCPP_URL="https://github.com/open-source-parsers/jsoncpp/archive/3515db184a836ce73b99c064bcc83884570657c2.tar.gz" From c1cebad4ab98712eba4ba32c900decbd10c03373 Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:06:07 -0400 Subject: [PATCH 02/11] Renamed install.conf to general.conf to reflect its new role. --- conf/default/{install.conf.default => general.conf.default} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conf/default/{install.conf.default => general.conf.default} (100%) diff --git a/conf/default/install.conf.default b/conf/default/general.conf.default similarity index 100% rename from conf/default/install.conf.default rename to conf/default/general.conf.default From 78203b5b673e6a0cd0031d7c40790ac5101ab4c4 Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:07:13 -0400 Subject: [PATCH 03/11] Modified file description header to reflect new name and role. --- conf/default/general.conf.default | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/default/general.conf.default b/conf/default/general.conf.default index d6c74a0d3..35a1d8e0a 100644 --- a/conf/default/general.conf.default +++ b/conf/default/general.conf.default @@ -16,14 +16,14 @@ # either express or implied. See the License for the specific language # governing permissions and limitations under the License. -# Purpose: Define configuration directives for setup +# Purpose: Define general configuration directives for setup # Date: 2014-08-18 -# Usage: Copy/rename this file to '../install.conf' and run setup.sh +# Usage: Copy/rename this file to '../general.conf' and run setup.sh ############################################# # Script Initialization -- do not edit. if [[ -z "$base_dir" ]]; then - echo "install.conf: base_dir must be set before sourcing this file." + echo "general.conf : base_dir must be set before sourcing this file." exit 1 fi env_name='env' From dfc81d5fad3124e8b538567b7c467d641331d4cc Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:09:22 -0400 Subject: [PATCH 04/11] Now ignoring all files of type conf in conf directory. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 46bc709d0..e271c3269 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ env build -conf/install.conf +conf/*.conf src/DoxyDocs src/examples/learningSpines/TetraSpine/logs From afd697c13541d6ea26af7c37416df9fde386471a Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:34:14 -0400 Subject: [PATCH 05/11] Refactored conf sourcing to support loading by file name. --- bin/setup/setup_common.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/setup/setup_common.sh b/bin/setup/setup_common.sh index 3314cb678..f922877bd 100755 --- a/bin/setup/setup_common.sh +++ b/bin/setup/setup_common.sh @@ -21,14 +21,18 @@ ############################### # Configuration -install_conf_file="$base_dir/conf/install.conf" -if [ ! -f "$install_conf_file" ]; then - echo "Missing install.conf ($install_conf_file). Please fix this and try again." - exit 1 -fi -source "$install_conf_file" +source_conf("general.conf") ############################### +function source_conf(conf_file_name) { + conf_file_name="$base_dir/conf/$conf_file_name" + if [ ! -f "$conf_file_name" ]; then + echo "Missing $conf_file_name. Please fix this and try again." + exit 1 + fi + source "$conf_file_name" +} + # Deteremine if a string contains a substring # Usage: tf=$(str_contains "my string" "substring") function str_contains() { From d70202704d3ab885b82060cc56a3d7068bbafcdd Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 01:40:00 -0400 Subject: [PATCH 06/11] Each package specific setup script now sources its package specific configuration. --- bin/setup/setup_boost.sh | 3 +++ bin/setup/setup_bullet.sh | 3 +++ bin/setup/setup_jsoncpp.sh | 3 +++ 3 files changed, 9 insertions(+) diff --git a/bin/setup/setup_boost.sh b/bin/setup/setup_boost.sh index b2af5dc26..3245e71be 100755 --- a/bin/setup/setup_boost.sh +++ b/bin/setup/setup_boost.sh @@ -24,6 +24,9 @@ local_setup_path="`dirname \"$0\"`" # relative base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and normalized source "$base_dir/bin/setup/setup_common.sh" +#Source this package's configuration +source_conf("boost.conf") + # Variables boost_pkg=`echo $BOOST_URL|awk -F/ '{print $NF}'` # get the package name from the url diff --git a/bin/setup/setup_bullet.sh b/bin/setup/setup_bullet.sh index 27a2044f1..2aeb7890b 100755 --- a/bin/setup/setup_bullet.sh +++ b/bin/setup/setup_bullet.sh @@ -24,6 +24,9 @@ local_setup_path="`dirname \"$0\"`" # relative base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and normalized source "$base_dir/bin/setup/setup_common.sh" +#Source this package's configuration +source_conf("bullet.conf") + # Adding 5-20-2014 for patching bullet SCRIPT_PATH="`dirname \"$0\"`" # relative SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`" # absolutized and normalized diff --git a/bin/setup/setup_jsoncpp.sh b/bin/setup/setup_jsoncpp.sh index 1c278baf7..8f8f4b6c4 100755 --- a/bin/setup/setup_jsoncpp.sh +++ b/bin/setup/setup_jsoncpp.sh @@ -24,6 +24,9 @@ local_setup_path="`dirname \"$0\"`" # relative base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and normalized source "$base_dir/bin/setup/setup_common.sh" +#Source this package's configuration +source_conf("jsoncpp.conf") + SCRIPT_PATH="`dirname \"$0\"`" # relative SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`" # absolutized and normalized setup_dir="$SCRIPT_PATH" From 6dbdea6828ce551effc545305f3ab7f46fd505e4 Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 02:16:01 -0400 Subject: [PATCH 07/11] Package configuration existence check (as well as creation) added. --- setup.sh | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index 9d1c29c10..e120218a0 100755 --- a/setup.sh +++ b/setup.sh @@ -27,7 +27,9 @@ SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`" # absolutized and normalized setup_dir="$SCRIPT_PATH/bin/setup" conf_dir="$SCRIPT_PATH/conf" base_dir="`( cd \"$setup_dir/\" && pwd )`" # Required for init scripts +CONF_FILES=("general.conf" "boost.conf" "bullet.conf" "jsoncpp.conf") +#Load our common set up functions function banner() { echo "" @@ -37,25 +39,42 @@ function banner() { function init_config() { if [ -f "$conf_dir/install.conf" ]; then - source "$conf_dir/install.conf" - return + echo "Your conf directory contains install.conf, which has been deprecated. Please delete install.conf and run set up again. See issue 21 for more details." + exit 1 fi echo "- Starting configuration" - message="Configuration file setup/install.conf not found -- would you like setup to create it now?" - options=("Y" "n") - default="Y" - result=$(read_options "$message" $options $default) - if [ "$result" == "Y" ]; then - cp "$conf_dir/default/install.conf.default" "$conf_dir/install.conf" - echo "conf/install.conf has been created. Please edit it as needed and re-run setup.sh." - else - echo "Please create a conf/install.conf before running setup. See conf/default/install.conf.default for an example." - fi - - exit 0 - + to_create=() + + for file_name in "${CONF_FILES[@]}" + do + if [ ! -f "$conf_dir/$file_name" ]; then + to_create+=($file_name) + fi + done + + if [ "${#to_create}" -eq 0 ]; then + source "$conf_dir/general.conf" + return + fi + + message="One or more package files do not exist. Would you like setup to create them now?" + options=("Y" "n") + default="Y" + result=$(read_options "$message" $options $default) + if [ "$result" == "Y" ]; then + for file_name in "${to_create[@]}" + do + echo "Creating conf/$file_name" + cp "$conf_dir/default/${file_name}.default" "$conf_dir/$file_name" + done + echo "All missing package configuration files have been created in conf/*. Please edit as needed and then re-run setup.sh." + else + echo "Please create all necessary conf files before running set up. See conf/default/* for a list of the needed files, as well as a base configuration." + fi + + exit 0 } function init_scripts() { From ba1c723112809d1ea77fe523c2f6fcc8bd09b429 Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 02:21:57 -0400 Subject: [PATCH 08/11] Fixed calls to source_conf --- bin/setup/setup_boost.sh | 2 +- bin/setup/setup_bullet.sh | 2 +- bin/setup/setup_common.sh | 11 ++++------- bin/setup/setup_jsoncpp.sh | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/setup/setup_boost.sh b/bin/setup/setup_boost.sh index 3245e71be..39f800bd8 100755 --- a/bin/setup/setup_boost.sh +++ b/bin/setup/setup_boost.sh @@ -25,7 +25,7 @@ base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and norma source "$base_dir/bin/setup/setup_common.sh" #Source this package's configuration -source_conf("boost.conf") +source_conf "boost.conf" # Variables boost_pkg=`echo $BOOST_URL|awk -F/ '{print $NF}'` # get the package name from the url diff --git a/bin/setup/setup_bullet.sh b/bin/setup/setup_bullet.sh index 2aeb7890b..eec82bde3 100755 --- a/bin/setup/setup_bullet.sh +++ b/bin/setup/setup_bullet.sh @@ -25,7 +25,7 @@ base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and norma source "$base_dir/bin/setup/setup_common.sh" #Source this package's configuration -source_conf("bullet.conf") +source_conf "bullet.conf" # Adding 5-20-2014 for patching bullet SCRIPT_PATH="`dirname \"$0\"`" # relative diff --git a/bin/setup/setup_common.sh b/bin/setup/setup_common.sh index f922877bd..29a3e7bfc 100755 --- a/bin/setup/setup_common.sh +++ b/bin/setup/setup_common.sh @@ -19,13 +19,8 @@ # Purpose: Common setup code # Date: 2014-08-18 -############################### -# Configuration -source_conf("general.conf") -############################### - -function source_conf(conf_file_name) { - conf_file_name="$base_dir/conf/$conf_file_name" +function source_conf() { + conf_file_name="$base_dir/conf/$1" if [ ! -f "$conf_file_name" ]; then echo "Missing $conf_file_name. Please fix this and try again." exit 1 @@ -33,6 +28,8 @@ function source_conf(conf_file_name) { source "$conf_file_name" } +source_conf "general.conf" + # Deteremine if a string contains a substring # Usage: tf=$(str_contains "my string" "substring") function str_contains() { diff --git a/bin/setup/setup_jsoncpp.sh b/bin/setup/setup_jsoncpp.sh index 8f8f4b6c4..a08ff1072 100755 --- a/bin/setup/setup_jsoncpp.sh +++ b/bin/setup/setup_jsoncpp.sh @@ -25,7 +25,7 @@ base_dir="`( cd \"$local_setup_path/../../\" && pwd )`" # absolutized and norma source "$base_dir/bin/setup/setup_common.sh" #Source this package's configuration -source_conf("jsoncpp.conf") +source_conf "jsoncpp.conf" SCRIPT_PATH="`dirname \"$0\"`" # relative SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`" # absolutized and normalized From fe6a83f2deca07a04cdd75838b16f54689e5c58e Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 02:25:58 -0400 Subject: [PATCH 09/11] Moved jsoncpp initialization ahead of bullet and boost so when boost gives an erroneous failure the next set up completes nearly instantly. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e120218a0..b7ecd940a 100755 --- a/setup.sh +++ b/setup.sh @@ -207,9 +207,9 @@ init_config init_scripts init_env init_cmake +init_jsoncpp init_bullet init_boost -init_jsoncpp echo "" echo "Setup Complete!" From 0d9d3c99c57ad0466710f2f9a12a2f505ce46f5f Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 02:49:46 -0400 Subject: [PATCH 10/11] Extracted true/false constants into setup_common.sh --- bin/setup/setup_boost.sh | 4 ---- bin/setup/setup_bullet.sh | 4 ---- bin/setup/setup_common.sh | 4 ++++ bin/setup/setup_jsoncpp.sh | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/bin/setup/setup_boost.sh b/bin/setup/setup_boost.sh index 39f800bd8..b60543047 100755 --- a/bin/setup/setup_boost.sh +++ b/bin/setup/setup_boost.sh @@ -30,10 +30,6 @@ source_conf "boost.conf" # Variables boost_pkg=`echo $BOOST_URL|awk -F/ '{print $NF}'` # get the package name from the url -# Constants -TRUE=0 # Yes, TRUE is 0 (e.g., no errors) -FALSE=1 # Ditto, FALSE is non-zero - function ensure_install_prefix_writable() { touch "$BOOST_INSTALL_PREFIX/tensegrity.deleteme" 2>/dev/null \ || { echo "Install prefix '$BOOST_INSTALL_PREFIX' is not writable -- please use sudo or execute as root."; exit 1; } diff --git a/bin/setup/setup_bullet.sh b/bin/setup/setup_bullet.sh index eec82bde3..4d043c3e1 100755 --- a/bin/setup/setup_bullet.sh +++ b/bin/setup/setup_bullet.sh @@ -36,10 +36,6 @@ setup_dir="$SCRIPT_PATH" # Variables bullet_pkg=`echo $BULLET_URL|awk -F/ '{print $NF}'` # get the package name from the url -# Constants -TRUE=0 # Yes, TRUE is 0 (e.g., no errors) -FALSE=1 # FALSE is non-zero - function ensure_install_prefix_writable() { touch "$BULLET_INSTALL_PREFIX/tensegrity.deleteme" 2>/dev/null \ || { echo "Install prefix '$BULLET_INSTALL_PREFIX' is not writable -- please use sudo or execute as root."; exit 1; } diff --git a/bin/setup/setup_common.sh b/bin/setup/setup_common.sh index 29a3e7bfc..2a708140d 100755 --- a/bin/setup/setup_common.sh +++ b/bin/setup/setup_common.sh @@ -30,6 +30,10 @@ function source_conf() { source_conf "general.conf" +# Constants +TRUE=0 # Yes, TRUE is 0 (e.g., no errors) +FALSE=1 # Ditto, FALSE is non-zero + # Deteremine if a string contains a substring # Usage: tf=$(str_contains "my string" "substring") function str_contains() { diff --git a/bin/setup/setup_jsoncpp.sh b/bin/setup/setup_jsoncpp.sh index a08ff1072..b441dfcae 100755 --- a/bin/setup/setup_jsoncpp.sh +++ b/bin/setup/setup_jsoncpp.sh @@ -34,10 +34,6 @@ setup_dir="$SCRIPT_PATH" # Variables jsoncpp_pkg=`echo $JSONCPP_URL|awk -F/ '{print $NF}'` # get the package name from the url -# Constants -TRUE=0 # Yes, TRUE is 0 (e.g., no errors) -FALSE=1 # FALSE is non-zero - function ensure_install_prefix_writable() { touch "$JSONCPP_INSTALL_PREFIX/tensegrity.deleteme" 2>/dev/null \ || { echo "Install prefix '$JSONCPP_INSTALL_PREFIX' is not writable -- please use sudo or execute as root."; exit 1; } From 2cbcc2c4e3d7e48e06d41685d85758958559b9a7 Mon Sep 17 00:00:00 2001 From: Perry Bhandal Date: Tue, 19 Aug 2014 03:07:21 -0400 Subject: [PATCH 11/11] Added SHA1 hashing (for file integrity verification) configuration options. --- conf/default/boost.conf.default | 3 +++ conf/default/bullet.conf.default | 3 +++ conf/default/general.conf.default | 5 +++++ conf/default/jsoncpp.conf.default | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/conf/default/boost.conf.default b/conf/default/boost.conf.default index 599027bb8..8de7173b1 100644 --- a/conf/default/boost.conf.default +++ b/conf/default/boost.conf.default @@ -41,3 +41,6 @@ BOOST_PACKAGE_DIR="$BOOST_BUILD_DIR" # e.g. http://url.com/for/boost.tgz or file:///path/to/boost.tgz BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz" +# Set the expected SHA1 hash for this package's download. +# Note: Hashes are only checked if a SHA1 sum utility is specified in general.conf +BOOST_SHA1="0e4ef26cc7780c6bbc63987ef2f29be920e2395b" diff --git a/conf/default/bullet.conf.default b/conf/default/bullet.conf.default index 6d40b2638..c2237632e 100644 --- a/conf/default/bullet.conf.default +++ b/conf/default/bullet.conf.default @@ -42,3 +42,6 @@ BULLET_PACKAGE_DIR="$BULLET_BUILD_DIR" # e.g. 'http://url.com/for/bullet.tgz' or 'file:///path/to/bullet.tgz' BULLET_URL="http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz" +# Set the expected SHA1 hash for this package's download. +# Note: Hashes are only checked if a SHA1 sum utility is specified in general.conf +BULLET_SHA1="a0867257b9b18e9829bbeb4c6c5872a5b29d1d33" diff --git a/conf/default/general.conf.default b/conf/default/general.conf.default index 35a1d8e0a..9ad7778f0 100644 --- a/conf/default/general.conf.default +++ b/conf/default/general.conf.default @@ -45,3 +45,8 @@ build_dir="$env_dir/build" # IMPORTANT: If you've previously installed to /usr/local, you'll need to # delete your 'env' directory before running setup again. INSTALL_PREFIX="$env_dir" + +# Set the path (or executable name if it's in your path) for the utility +# to use for SHA1 summing. To disable download integrity verification +# simply set the variable to an empty string. +SHA1SUM_UTILITY="sha1sum" diff --git a/conf/default/jsoncpp.conf.default b/conf/default/jsoncpp.conf.default index 20e91a9e9..e438bef97 100644 --- a/conf/default/jsoncpp.conf.default +++ b/conf/default/jsoncpp.conf.default @@ -40,3 +40,7 @@ JSONCPP_PACKAGE_DIR="$JSONCPP_BUILD_DIR" # JSONCPP_URL can be either a web address or a local file address, # e.g. http://url.com/for/jsoncpp.tgz or file:///path/to/jsoncpp.tgz JSONCPP_URL="https://github.com/open-source-parsers/jsoncpp/archive/3515db184a836ce73b99c064bcc83884570657c2.tar.gz" + +# Set the expected SHA1 hash for this package's download. +# Note: Hashes are only checked if a SHA1 sum utility is specified in general.conf +JSONCPP_SHA1="a2824f2c5a46b85ce78ca438b2aabdd7a382697c"