sdk-update.sh 662 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. PRJ_VER=$1
  3. PREFIX=${PRJ_VER:0:3}
  4. VER_REF=`git show-ref refs/heads/$PRJ_VER`
  5. if [ "$PRJ_VER" == "" ]; then
  6. echo "Usage: ./sdk-update.sh [branch/tag]"
  7. exit
  8. fi
  9. echo -e "\n--== git checkout $PRJ_VER ==--\n"
  10. source ./zephyr-env.sh
  11. git checkout .
  12. git fetch
  13. if [ "$PREFIX" == "TAG" ]; then
  14. if [ "$VER_REF" == "" ]; then
  15. git checkout -b $PRJ_VER tags/$PRJ_VER
  16. else
  17. git checkout $PRJ_VER
  18. fi
  19. west config manifest.file tag.yml
  20. else
  21. if [ "$VER_REF" == "" ]; then
  22. git checkout -b $PRJ_VER remotes/origin/$PRJ_VER
  23. else
  24. git checkout $PRJ_VER
  25. git rebase remotes/origin/$PRJ_VER
  26. fi
  27. west config manifest.file west.yml
  28. fi
  29. ./sdk-reset.sh