Mercurial > hg > beaglert
changeset 458:84841654c606 prerelease
update is a bit more clean through Makefile
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 20 Jun 2016 02:48:31 +0100 |
parents | 44e5c12ce165 |
children | f48d28244fe2 |
files | Makefile scripts/ide.sh |
diffstat | 2 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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)