Mercurial > hg > beaglert
comparison scripts/build_project.sh @ 275:428f13c2cb49 prerelease
build_project.sh fixed folder handling by rsync
| author | Giulio Moro <giuliomoro@yahoo.it> |
|---|---|
| date | Tue, 17 May 2016 15:12:08 +0100 |
| parents | 156191dffa8c |
| children | 4b3ae93ab102 |
comparison
equal
deleted
inserted
replaced
| 267:247a182adb6d | 275:428f13c2cb49 |
|---|---|
| 79 # echo "Usage: $THIS_SCRIPT [directory-with-source-files]" | 79 # echo "Usage: $THIS_SCRIPT [directory-with-source-files]" |
| 80 usage | 80 usage |
| 81 exit | 81 exit |
| 82 fi | 82 fi |
| 83 | 83 |
| 84 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME"/" | 84 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here |
| 85 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER | 85 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER |
| 86 | 86 |
| 87 # Stop BeagleRT and clean out old source files | 87 # Stop BeagleRT and clean out old source files |
| 88 echo "Stopping running program..." | 88 echo "Stopping running program..." |
| 89 # sets the date, stops the running process | 89 # sets the date, stops the running process |
| 91 | 91 |
| 92 #concatenate arguments to form path. | 92 #concatenate arguments to form path. |
| 93 HOST_SOURCE_PATH= #initially empty, will be filled with input arguments | 93 HOST_SOURCE_PATH= #initially empty, will be filled with input arguments |
| 94 for i in "$@" #parse input arguments | 94 for i in "$@" #parse input arguments |
| 95 do | 95 do |
| 96 HOST_SOURCE_PATH+=" $1 " | 96 HOST_SOURCE_PATH+=" $1" |
| 97 shift | 97 shift |
| 98 # Copy new souce files to the board | 98 # Copy new souce files to the board |
| 99 done | 99 done |
| 100 | 100 |
| 101 # Copy new source files to the board | 101 # Copy new source files to the board |
| 106 #and copy over all the files again and recompile them | 106 #and copy over all the files again and recompile them |
| 107 ssh bbb "make -C $BBB_BELA_HOME sourceclean PROJECT=$BBB_PROJECT_NAME"; | 107 ssh bbb "make -C $BBB_BELA_HOME sourceclean PROJECT=$BBB_PROJECT_NAME"; |
| 108 scp $HOST_SOURCE_PATH "$BBB_NETWORK_TARGET_FOLDER" | 108 scp $HOST_SOURCE_PATH "$BBB_NETWORK_TARGET_FOLDER" |
| 109 else | 109 else |
| 110 #rsync --delete makes sure it removes files that are not in the origin folder | 110 #rsync --delete makes sure it removes files that are not in the origin folder |
| 111 rsync -av --delete-after --exclude=build $HOST_SOURCE_PATH "$BBB_NETWORK_TARGET_FOLDER" | 111 rsync -av --delete-after --exclude=build $HOST_SOURCE_PATH"/" "$BBB_NETWORK_TARGET_FOLDER/" #trailing slashes used here make sure rsync does not create another folder inside the target folder |
| 112 fi; | 112 fi; |
| 113 | 113 |
| 114 if [ $? -ne 0 ] | 114 if [ $? -ne 0 ] |
| 115 then | 115 then |
| 116 echo "Error while copying files" | 116 echo "Error while copying files" |
