clone_or_update_tizen_repos 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/bash
  2. # Arguments = -r qtbase,qtdeclarative,...,qtxmlpatterns -f
  3. set -e
  4. usage()
  5. {
  6. cat << EOF
  7. usage: $0 options
  8. This script will download and sync tizen repos with upstream
  9. OPTIONS:
  10. -h Show this message
  11. -r REPO_LIST comma separated list of qt repositories to clone
  12. -p PREFIX repo prefix
  13. example:
  14. $0 -r qtbase,qtdeclarative,qtquickcontrols-tizen -p http://git.gitorious.org/qt/qt-for-tizen-packaging-
  15. EOF
  16. }
  17. qtparts=""
  18. while getopts ":hr:p:" opt; do
  19. case $opt in
  20. h)
  21. usage
  22. exit
  23. ;;
  24. r)
  25. qtparts=$(echo $OPTARG| sed "s/,/ /gi")
  26. ;;
  27. ?)
  28. echo "Invalid option: -$OPTARG"
  29. usage
  30. exit
  31. ;;
  32. esac
  33. done
  34. if [ "$repo_prefix" == "" ]; then
  35. repo_prefix=http://git.gitorious.org/qt/qt-for-tizen-packaging-
  36. fi
  37. if [ "$qtparts" == "" ]; then
  38. parts="qtchooser qtbase qtxmlpatterns qtdeclarative qtgraphicaleffects qtimageformats qtquickcontrols qtquickcontrols-tizen qtsensors qttools qtwayland qtmultimedia"
  39. else
  40. parts="$qtparts"
  41. fi
  42. SCRIPTDIR=$(dirname $0)
  43. source $SCRIPTDIR/../common/qt_for_tizen_version
  44. for qtrepo in $parts; do
  45. if [ -d "$qtrepo" ]; then
  46. echo =============================================
  47. echo $qtrepo already exists - syncing with origin
  48. echo =============================================
  49. cd $qtrepo
  50. git fetch origin
  51. git checkout $QT_FOR_TIZEN_PACKAGING_BRANCH
  52. git reset --hard origin/$QT_FOR_TIZEN_PACKAGING_BRANCH
  53. cd ..
  54. else
  55. echo =============================================
  56. echo cloning $qtrepo
  57. echo =============================================
  58. git clone -b $QT_FOR_TIZEN_PACKAGING_BRANCH $repo_prefix$qtrepo.git $qtrepo
  59. fi
  60. done