# HG changeset patch # User Giulio Moro # Date 1466387311 -3600 # Node ID 84841654c606c700ce630b1441200748264ce711 # Parent 44e5c12ce165ba036e7ce901c72174c8b1ea127a update is a bit more clean through Makefile diff -r 44e5c12ce165 -r 84841654c606 Makefile --- a/Makefile Mon Jun 20 02:20:45 2016 +0100 +++ b/Makefile Mon Jun 20 02:48:31 2016 +0100 @@ -323,9 +323,10 @@ @[ -n $(UPDATE_SOURCE_DIR_BASE) ] && rm -rf $(UPDATE_SOURCE_DIR_BASE) && mkdir -p $(UPDATE_SOURCE_DIR_BASE) # Unzip the contents to the temp folder @cd $(UPDATE_SOURCE_DIR_BASE) && unzip -qq $(UPDATES_DIR)/*zip -# Strip the top-level folder ( if there is only one ) +#TODO: this should not be needed. Remove comments. Strip the top-level folder ( if there is only one ) #@DIR=`ls -d $(UPDATE_SOURCE_DIR)` && COUNT=`echo $$DIR | wc -l` &&\ [ $$COUNT -eq 1 ] && mv $(UPDATE_SOURCE_DIR)/* /tmp/supertemp && rm -rf $(UPDATE_SOURCE_DIR) && mv /tmp/supertemp $(UPDATE_SOURCE_DIR) + # Now actually check if some key-files and folders are there @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } @@ -340,13 +341,15 @@ # Now actually check if some key-files and folders are there @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } - # Duplicate the Bela folder $(BELA_DIR) to $(UPDATE_BELA_PATCH) ... @[ -n $(UPDATE_BELA_PATCH) ] && mkdir -p $(UPDATE_BELA_PATCH) @#TODO: this would allow to trim trailing slashes in case we want to be safer: a="`pwd`/" ; target=${a%/} ; echo $target - @rsync -a --delete-before $(BELA_DIR)/ $(UPDATE_BELA_PATCH) - # Also backing it up in $(UPDATE_BELA_BACKUP)... + # Clean folder + @$(MAKE) --no-print-directory coreclean + # Duplicate the Bela folder $(BELA_DIR) to $(UPDATE_BELA_PATCH) ... + @rsync -a --delete-during --exclude Documentation $(BELA_DIR)/ $(UPDATE_BELA_PATCH) + # Also backing it up in $(UPDATE_BELA_BACKUP) ... @[ -n $(UPDATE_BELA_BACKUP) ] && mkdir -p $(UPDATE_BELA_BACKUP) - @rsync -a $(BELA_DIR)/ $(UPDATE_BELA_BACKUP) + @rsync -a --delete-during $(BELA_DIR)/ $(UPDATE_BELA_BACKUP) # Here's the trick: we run "update_board" ssh'ing into the BeagleBone itself! @cd $(UPDATE_SOURCE_DIR)/scripts && BBB_ADDRESS=root@127.0.0.1 BBB_BELA_HOME=$(UPDATE_BELA_PATCH) ./update_board -y --no-frills # If everything went ok, we now have the updated version of $(BELA_DIR) in $(UPDATE_BELA_PATCH) and a backup of $(BELA_DIR) in $(UPDATE_BELA_BACKUP) diff -r 44e5c12ce165 -r 84841654c606 scripts/ide.sh --- a/scripts/ide.sh Mon Jun 20 02:20:45 2016 +0100 +++ b/scripts/ide.sh Mon Jun 20 02:48:31 2016 +0100 @@ -22,7 +22,6 @@ do case $1 in start) - echo ssh $BBB_ADDRESS $MAKE_COMMAND idestart ssh $BBB_ADDRESS $MAKE_COMMAND idestart exit $? ;;