summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2016-01-11 12:07:18 -0600
committerMike Fiore <mfiore@multitech.com>2016-01-11 12:07:18 -0600
commit901e2f9c3734447ea3936f556d1a88e29b8b2034 (patch)
tree7c03dac1384285d89f8f4c25fb553691ad3db366
parentc3ce8e7063a424be539ec853102be7191b13cef0 (diff)
downloadmtdot-box-evb-factory-firmware-901e2f9c3734447ea3936f556d1a88e29b8b2034.tar.gz
mtdot-box-evb-factory-firmware-901e2f9c3734447ea3936f556d1a88e29b8b2034.tar.bz2
mtdot-box-evb-factory-firmware-901e2f9c3734447ea3936f556d1a88e29b8b2034.zip
update setup script to checkout specific versions of mercurial libraries
-rwxr-xr-xsetup.sh38
1 files changed, 25 insertions, 13 deletions
diff --git a/setup.sh b/setup.sh
index 1c34019..19ea332 100755
--- a/setup.sh
+++ b/setup.sh
@@ -2,22 +2,34 @@
DIR=$(pwd)
LIB="libs/"
-LIBS=("ISL29011" "MMA845x" "MPL3115A2" "NCP5623B" "GpsParser" "DOGS102")
-echo "creating libs directory..."
-mkdir -p libs/
+# 2 parameters
+# param1: string name of library
+# param2: number mercurial revision to use
+update_hg_lib() {
+ cd $LIB
-for i in ${LIBS[@]}; do
- cd $DIR
- if [ ! -d "$LIB/${i}" ]; then
- echo "cloning ${i}"
- hg clone https://developer.mbed.org/teams/Multi-Hackers/code/${i} $LIB/${i}
- else
- cd $LIB/${i}
- echo "updating ${i}"
- hg pull
+ if [ ! -d "$1" ]; then
+ echo "cloning $1"
+ hg clone https://developer.mbed.org/teams/Multi-Hackers/code/$1 ./$1
fi
-done
+
+ cd $1
+ echo "checkout revision $2 of $1"
+ hg checkout $2
+
+ cd $DIR
+}
+
+echo "creating libs directory..."
+mkdir -p $LIB
+
+update_hg_lib "ISL29011" 3
+update_hg_lib "MMA845x" 3
+update_hg_lib "MPL3115A2" 2
+update_hg_lib "NCP5623B" 3
+update_hg_lib "GpsParser" 10
+update_hg_lib "DOGS102" 4
echo "generating version header..."
cd $DIR