From 683259decbcb1ebcbbe8664cd83ad34c2862b26a Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 12:56:47 -0800 Subject: [PATCH 1/6] pip install git+URL@dev instead of cloning --- bin/oref0-setup.sh | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 47cd4efa..bfebf383 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -322,20 +322,21 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then (cd ~/src/Adafruit_Python_BluefruitLE && git fetch && git checkout wip/bewest/custom-gatt-profile && git pull) || die "Couldn't pull latest Adafruit_Python_BluefruitLE wip/bewest/custom-gatt-profile" else echo -n "Cloning Adafruit_Python_BluefruitLE wip/bewest/custom-gatt-profile: " + # TODO: get this moved over to openaps and install with pip (cd ~/src && git clone -b wip/bewest/custom-gatt-profile https://github.com/bewest/Adafruit_Python_BluefruitLE.git) || die "Couldn't clone Adafruit_Python_BluefruitLE wip/bewest/custom-gatt-profile" fi echo Installing Adafruit_BluefruitLE && cd $HOME/src/Adafruit_Python_BluefruitLE && sudo python setup.py develop || die "Couldn't install Adafruit_BluefruitLE" fi - if [ -d "$HOME/src/openxshareble/" ]; then - echo "$HOME/src/openxshareble/ already exists; pulling latest dev branch" - (cd ~/src/openxshareble && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openxshareble dev" - else - echo -n "Cloning openxshareble dev: " - (cd ~/src && git clone -b dev https://github.com/openaps/openxshareble.git) || die "Couldn't clone openxshareble dev" - fi + #if [ -d "$HOME/src/openxshareble/" ]; then + #echo "$HOME/src/openxshareble/ already exists; pulling latest dev branch" + #(cd ~/src/openxshareble && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openxshareble dev" + #else + #echo -n "Cloning openxshareble dev: " + #(cd ~/src && git clone -b dev https://github.com/openaps/openxshareble.git) || die "Couldn't clone openxshareble dev" + #fi echo Checking openxshareble installation if ! python -c "import openxshareble" 2>/dev/null; then - echo Installing openxshareble && (cd $HOME/src/openxshareble && sudo python setup.py develop) || die "Couldn't install openxshareble" + echo Installing openxshareble && pip install git+https://github.com/openaps/openxshareble.git@dev || die "Couldn't install openxshareble" fi sudo apt-get -y install bc jq libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-dbus || die "Couldn't apt-get install: run 'sudo apt-get update' and try again?" echo Checking bluez installation @@ -353,14 +354,14 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then sed -i"" 's/^screen -S "brcm_patchram_plus" -d -m \/usr\/local\/sbin\/bluetooth_patchram.sh/# &/' /etc/rc.local echo Checking openaps dev installation if ! openaps --version | egrep "0.[2-9].[0-9]"; then - if [ -d "$HOME/src/openaps/" ]; then - echo "$HOME/src/openaps/ already exists; pulling latest dev branch" - (cd ~/src/openaps && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openaps dev" - else - echo -n "Cloning openaps dev: " - (cd ~/src && git clone -b dev git://github.com/openaps/openaps.git) || die "Couldn't clone openaps dev" - fi - echo Installing latest openaps dev && (cd $HOME/src/openaps/ && sudo python setup.py develop) || die "Couldn't install openaps" + #if [ -d "$HOME/src/openaps/" ]; then + #echo "$HOME/src/openaps/ already exists; pulling latest dev branch" + #(cd ~/src/openaps && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openaps dev" + #else + #echo -n "Cloning openaps dev: " + #(cd ~/src && git clone -b dev git://github.com/openaps/openaps.git) || die "Couldn't clone openaps dev" + #fi + echo Installing latest openaps dev && pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" fi mkdir -p $directory-cgm-loop @@ -411,14 +412,15 @@ killall -g openaps 2>/dev/null; openaps device remove pump 2>/dev/null if [[ "$ttyport" =~ "spi" ]]; then echo Checking spi_serial installation if ! python -c "import spi_serial" 2>/dev/null; then - if [ -d "$HOME/src/915MHzEdisonExplorer_SW/" ]; then - echo "$HOME/src/915MHzEdisonExplorer_SW/ already exists; pulling latest master branch" - (cd ~/src/915MHzEdisonExplorer_SW && git fetch && git checkout master && git pull) || die "Couldn't pull latest 915MHzEdisonExplorer_SW master" - else - echo -n "Cloning 915MHzEdisonExplorer_SW master: " - (cd ~/src && git clone -b master https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git) || die "Couldn't clone 915MHzEdisonExplorer_SW master" - fi - echo Installing spi_serial && cd $HOME/src/915MHzEdisonExplorer_SW/spi_serial && sudo pip install -e . || die "Couldn't install spi_serial" + #if [ -d "$HOME/src/915MHzEdisonExplorer_SW/" ]; then + #echo "$HOME/src/915MHzEdisonExplorer_SW/ already exists; pulling latest master branch" + #(cd ~/src/915MHzEdisonExplorer_SW && git fetch && git checkout master && git pull) || die "Couldn't pull latest 915MHzEdisonExplorer_SW master" + #else + #echo -n "Cloning 915MHzEdisonExplorer_SW master: " + #(cd ~/src && git clone -b master https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git) || die "Couldn't clone 915MHzEdisonExplorer_SW master" + #fi + #echo Installing spi_serial && cd $HOME/src/915MHzEdisonExplorer_SW/spi_serial && sudo pip install -e . || die "Couldn't install spi_serial" + echo Installing spi_serial && pip install git+https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git@master || die "Couldn't install spi_serial" fi echo Checking mraa installation From 0d83539e91c0027d5e4e558a0fef15922a02f6f8 Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 19:52:03 -0800 Subject: [PATCH 2/6] sudo pip install --- bin/oref0-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index bf655284..c30b1892 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -336,7 +336,7 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then #fi echo Checking openxshareble installation if ! python -c "import openxshareble" 2>/dev/null; then - echo Installing openxshareble && pip install git+https://github.com/openaps/openxshareble.git@dev || die "Couldn't install openxshareble" + echo Installing openxshareble && sudo pip install git+https://github.com/openaps/openxshareble.git@dev || die "Couldn't install openxshareble" fi sudo apt-get -y install bc jq libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-dbus || die "Couldn't apt-get install: run 'sudo apt-get update' and try again?" echo Checking bluez installation @@ -361,7 +361,7 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then #echo -n "Cloning openaps dev: " #(cd ~/src && git clone -b dev git://github.com/openaps/openaps.git) || die "Couldn't clone openaps dev" #fi - echo Installing latest openaps dev && pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" + echo Installing latest openaps dev && sudo pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" fi mkdir -p $directory-cgm-loop @@ -420,7 +420,7 @@ if [[ "$ttyport" =~ "spi" ]]; then #(cd ~/src && git clone -b master https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git) || die "Couldn't clone 915MHzEdisonExplorer_SW master" #fi #echo Installing spi_serial && cd $HOME/src/915MHzEdisonExplorer_SW/spi_serial && sudo pip install -e . || die "Couldn't install spi_serial" - echo Installing spi_serial && pip install git+https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git@master || die "Couldn't install spi_serial" + echo Installing spi_serial && sudo pip install git+https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git@master || die "Couldn't install spi_serial" fi echo Checking mraa installation From ae1f53dab03865b1d395510c1c9b81d325e624e4 Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 19:53:33 -0800 Subject: [PATCH 3/6] move openaps dev install out where it belongs --- bin/oref0-setup.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index c30b1892..d5e418ee 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -352,17 +352,6 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then fi # comment out existing line if it exists and isn't already commented out sed -i"" 's/^screen -S "brcm_patchram_plus" -d -m \/usr\/local\/sbin\/bluetooth_patchram.sh/# &/' /etc/rc.local - echo Checking openaps dev installation - if ! openaps --version | egrep "0.[2-9].[0-9]"; then - #if [ -d "$HOME/src/openaps/" ]; then - #echo "$HOME/src/openaps/ already exists; pulling latest dev branch" - #(cd ~/src/openaps && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openaps dev" - #else - #echo -n "Cloning openaps dev: " - #(cd ~/src && git clone -b dev git://github.com/openaps/openaps.git) || die "Couldn't clone openaps dev" - #fi - echo Installing latest openaps dev && sudo pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" - fi mkdir -p $directory-cgm-loop if ( cd $directory-cgm-loop && git status 2>/dev/null >/dev/null && openaps use -h >/dev/null ); then @@ -442,6 +431,11 @@ if [[ "$ttyport" =~ "spi" ]]; then fi +echo Checking openaps dev installation +if ! openaps --version | egrep "0.[2-9].[0-9]"; then + echo Installing latest openaps dev && sudo pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" +fi + cd $directory || die "Can't cd $directory" if [[ -z "$ttyport" ]]; then openaps device add pump medtronic $serial || die "Can't add pump" From b29a0a21e393dee10340aa4af2812b8bde000826 Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 19:53:55 -0800 Subject: [PATCH 4/6] remove commented code --- bin/oref0-setup.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index d5e418ee..27261e71 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -327,13 +327,6 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then fi echo Installing Adafruit_BluefruitLE && cd $HOME/src/Adafruit_Python_BluefruitLE && sudo python setup.py develop || die "Couldn't install Adafruit_BluefruitLE" fi - #if [ -d "$HOME/src/openxshareble/" ]; then - #echo "$HOME/src/openxshareble/ already exists; pulling latest dev branch" - #(cd ~/src/openxshareble && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openxshareble dev" - #else - #echo -n "Cloning openxshareble dev: " - #(cd ~/src && git clone -b dev https://github.com/openaps/openxshareble.git) || die "Couldn't clone openxshareble dev" - #fi echo Checking openxshareble installation if ! python -c "import openxshareble" 2>/dev/null; then echo Installing openxshareble && sudo pip install git+https://github.com/openaps/openxshareble.git@dev || die "Couldn't install openxshareble" @@ -401,14 +394,6 @@ killall -g openaps 2>/dev/null; openaps device remove pump 2>/dev/null if [[ "$ttyport" =~ "spi" ]]; then echo Checking spi_serial installation if ! python -c "import spi_serial" 2>/dev/null; then - #if [ -d "$HOME/src/915MHzEdisonExplorer_SW/" ]; then - #echo "$HOME/src/915MHzEdisonExplorer_SW/ already exists; pulling latest master branch" - #(cd ~/src/915MHzEdisonExplorer_SW && git fetch && git checkout master && git pull) || die "Couldn't pull latest 915MHzEdisonExplorer_SW master" - #else - #echo -n "Cloning 915MHzEdisonExplorer_SW master: " - #(cd ~/src && git clone -b master https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git) || die "Couldn't clone 915MHzEdisonExplorer_SW master" - #fi - #echo Installing spi_serial && cd $HOME/src/915MHzEdisonExplorer_SW/spi_serial && sudo pip install -e . || die "Couldn't install spi_serial" echo Installing spi_serial && sudo pip install git+https://github.com/EnhancedRadioDevices/915MHzEdisonExplorer_SW.git@master || die "Couldn't install spi_serial" fi From c097b948b1b91ce27cf1ecf92e37405261c284a4 Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 19:59:03 -0800 Subject: [PATCH 5/6] bump version and require oref0@0.3.6 or later --- bin/oref0-setup.sh | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 27261e71..8ecba169 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -258,7 +258,7 @@ else (cd ~/src && git clone git://github.com/openaps/oref0.git) || die "Couldn't clone oref0" fi echo Checking oref0 installation -npm list -g oref0 | egrep oref0@0.3. || (echo Installing latest oref0 && sudo npm install -g oref0) +npm list -g oref0 | egrep oref0@0.3.[6-9] || (echo Installing latest oref0 && sudo npm install -g oref0) #(echo Installing latest oref0 dev && cd $HOME/src/oref0/ && npm run global-install) echo Checking mmeowlink installation diff --git a/package.json b/package.json index b903b02d..09645404 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oref0", - "version": "0.3.5-dev", + "version": "0.3.6-dev", "description": "openaps oref0 reference implementation of the reference design", "scripts": { "test": "make test", From 03e89767ca5776cf3078afd2d4ee4c48d29de100 Mon Sep 17 00:00:00 2001 From: Scott Leibrand Date: Sun, 8 Jan 2017 20:14:14 -0800 Subject: [PATCH 6/6] redirect stderr to stdout so we can grep it --- bin/oref0-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 8ecba169..90d5bde1 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -417,7 +417,7 @@ if [[ "$ttyport" =~ "spi" ]]; then fi echo Checking openaps dev installation -if ! openaps --version | egrep "0.[2-9].[0-9]"; then +if ! openaps --version 2>&1 | egrep "0.[2-9].[0-9]"; then echo Installing latest openaps dev && sudo pip install git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps" fi