comparison scripts/update_board.sh @ 420:669855b8461b prerelease

update_board.sh now correctly resolves relative paths to the $IDE_FOLDER
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 16 Jun 2016 13:54:48 +0100
parents 4fb06ca94e02
children 57903b3259e1
comparison
equal deleted inserted replaced
419:4fb06ca94e02 420:669855b8461b
96 fi 96 fi
97 else 97 else
98 echo "Installing Bela core code in $BBB_ADDRESS:$BBB_BELA_HOME" 98 echo "Installing Bela core code in $BBB_ADDRESS:$BBB_BELA_HOME"
99 fi 99 fi
100 100
101 echo "Updating Bela core files to remote folder $BBB_BELA_HOME" 101 echo "Updating Bela cores files to remote folder $BBB_BELA_HOME"
102 # Stop Bela if running and remove all files 102 # Stop Bela if running and remove all files
103 printf "Stopping Bela..." 103 printf "Stopping Bela..."
104 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME idestop stop &>/dev/null; screen -X -S Bela quit &>/dev/null; screen -X -S IDE-Bela quit &>/dev/null; true"; 104 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME idestop stop &>/dev/null; screen -X -S Bela quit &>/dev/null; screen -X -S IDE-Bela quit &>/dev/null; true";
105 error_handler $? 105 error_handler $?
106 106
112 fi 112 fi
113 113
114 #Check if rsync is available 114 #Check if rsync is available
115 [ -z `which rsync` ] && RSYNC_AVAILABLE=0 || RSYNC_AVAILABLE=1 115 [ -z `which rsync` ] && RSYNC_AVAILABLE=0 || RSYNC_AVAILABLE=1
116 116
117 # cd to the home of the project to make the following lines less verbose
118 RUN_FOLDER=`pwd`
117 cd $SCRIPTDIR/../ 119 cd $SCRIPTDIR/../
120
118 printf "Updating files..." 121 printf "Updating files..."
119 # Copy relevant files to BeagleBone Black 122 # Copy relevant files to BeagleBone Black
120 if [ $RSYNC_AVAILABLE -eq 1 ]; 123 if [ $RSYNC_AVAILABLE -eq 1 ];
121 then 124 then
122 [ -z `which sed` ] && FILTER=cat || FILTER="sed s/\\n// | sed s/^.*:/Updated\ files:\/g | tr \"\n\" \" \"" 125 [ -z `which sed` ] && FILTER=cat || FILTER="sed s/\\n// | sed s/^.*:/Updated\ files:\/g | tr \"\n\" \" \""
127 ssh $BBB_ADDRESS "rm -rf $FILES_TO_COPY; mkdir -p $BBB_BELA_HOME" &&\ 130 ssh $BBB_ADDRESS "rm -rf $FILES_TO_COPY; mkdir -p $BBB_BELA_HOME" &&\
128 scp -r -q $FILES_TO_COPY $BBB_ADDRESS:$BBB_BELA_HOME &&\ 131 scp -r -q $FILES_TO_COPY $BBB_ADDRESS:$BBB_BELA_HOME &&\
129 scp -q libpd.so $BBB_ADDRESS:/usr/lib 132 scp -q libpd.so $BBB_ADDRESS:/usr/lib
130 fi 133 fi
131 error_handler $? 134 error_handler $?
135 # cd back to the original folder.
136 cd "$RUN_FOLDER"
132 137
133 # Create remaining directories needed for building 138 # Create remaining directories needed for building
134 printf "Creating directory structure on BeagleBone..." 139 printf "Creating directory structure on BeagleBone..."
135 ssh $BBB_ADDRESS "mkdir -p $BBB_BELA_HOME/build/core $BBB_BELA_HOME/projects" 140 ssh $BBB_ADDRESS "mkdir -p $BBB_BELA_HOME/build/core $BBB_BELA_HOME/projects"
136 error_handler $? 141 error_handler $?
142 #------------- 147 #-------------
143 #Installing IDE 148 #Installing IDE
144 stat $IDE_FOLDER/scripts/setup_IDE.sh &> /dev/null 149 stat $IDE_FOLDER/scripts/setup_IDE.sh &> /dev/null
145 if [ $? -eq 0 ] 150 if [ $? -eq 0 ]
146 then 151 then
147 cd $IDE_FOLDER/scripts; 152 cd $IDE_FOLDER/scripts && ./setup_IDE.sh -y
148 ./setup_IDE.sh -y
149 # run the IDE 153 # run the IDE
150 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" 154 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
151 else 155 else
152 # run the IDE 156 # run the IDE
153 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" 157 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
154 echo \ 158 echo \
155 "Bela was installed on the board, but the IDE files were not found, so the IDE was not installed. If there was an older version of the IDE on the board, it is being restarted. 159 "Bela was installed on 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.
156 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide" 160 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide"
157 fi 161 fi