changeset 428:b27676f871d7 prerelease

Some more sh compatiblity things: no &>, no 'function'
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 16 Jun 2016 19:20:22 +0100
parents fd948111f8ea
children 8533f7198644
files scripts/build_pd_heavy.sh scripts/update_board.sh
diffstat 2 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/build_pd_heavy.sh	Thu Jun 16 18:09:59 2016 +0100
+++ b/scripts/build_pd_heavy.sh	Thu Jun 16 19:20:22 2016 +0100
@@ -29,7 +29,7 @@
 
 if [ -z "$BELA_PYTHON27" ]; then
     for PY in python python2.7 ; do
-        python --version 2>&1 | grep "2\.7" &> /dev/null
+        python --version 2>&1 | grep "2\.7" >/dev/null 2>&1
         if [ $? -eq 0 ]; then
             BELA_PYTHON27=$PY
             break;
@@ -104,7 +104,7 @@
     if [ $NO_UPLOAD -eq 0 ]; then
         # remove old static files to avoid obsolete errors
         # use -rf to prevent warnings in case they do not exist
-        rm -rf "$projectpath"/Hv* "$projectpath"/Message* "$projectpath"/Control* "$projectpath"/Signal* &>/dev/null
+        rm -rf "$projectpath"/Hv* "$projectpath"/Message* "$projectpath"/Control* "$projectpath"/Signal* >/dev/null 2>&1
 
         # invoke the online compiler
         "$BELA_PYTHON27" hvresources/uploader.py "$pdpath"/ -n bbb -g c -o "$projectpath" $RELEASE_STRING;
--- a/scripts/update_board.sh	Thu Jun 16 18:09:59 2016 +0100
+++ b/scripts/update_board.sh	Thu Jun 16 19:20:22 2016 +0100
@@ -15,7 +15,7 @@
 BELA_IDE_SCREEN_NAME=IDE-Bela
 SCREEN_NAME=Bela
 
-function usage
+usage ()
 {
     THIS_SCRIPT=`basename "$0"`
     echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [--clean] [-y]"
@@ -36,9 +36,16 @@
     -y : does not prompt the user before deleting the remote files.
     "
 }
-trap "echo; exit" SIGINT SIGTERM
 
-function error_handler {
+signal_handler ()
+{
+  echo
+  exit
+}
+
+trap signal_handler SIGINT SIGTERM
+
+error_handler () {
  [ $1 -eq 0 ] && printf "done\n" || { [ -z "$2" ] && printf "\nAn error occurred. Is the board connected?\n" || printf "$2"; exit 1; }
 }
 
@@ -140,15 +147,15 @@
 error_handler $?
 
 printf "Generating on-board documentation..."
-ssh $BBB_ADDRESS "cd $BBB_BELA_HOME; doxygen &>/dev/null"
+#ssh $BBB_ADDRESS "cd $BBB_BELA_HOME; doxygen &> /dev/null"
 error_handler $? "\nError while generating Doxygen documentation\n"
 
 #-------------
 #Installing IDE
-ls $IDE_FOLDER/scripts/setup_IDE.sh &> /dev/null
+ls $IDE_FOLDER/scripts/setup_IDE.sh >/dev/null 2>/dev/null
 if [ $? -eq 0 ]
 then
-  cd $IDE_FOLDER/scripts && ./setup_IDE.sh -y
+  cd $IDE_FOLDER/scripts && ./setup_IDE.sh -
   # run the IDE 
   ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
 else
@@ -156,7 +163,8 @@
   ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
   echo \
 "The Bela core files were updated the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated. If there was an older version of the IDE on the board, it is being restarted.
-You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide"
+You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide
+"
 fi
 
 ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && echo "The board will now run the IDE at startup, but startup of the Bela program has been disabled. To enable it, use the set_startup.sh script"