webrtc_update.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4. # You can obtain one at http://mozilla.org/MPL/2.0/.
  5. # First, get a new copy of the tree to play with
  6. # They both want to be named 'trunk'...
  7. mkdir webrtc_update
  8. cd webrtc_update
  9. # Note: must be in trunk; won't work with --name (error during sync)
  10. gclient config --name trunk http://webrtc.googlecode.com/svn/trunk/peerconnection
  11. gclient sync --force
  12. if [ $2 ] ; then
  13. if [ $3 ] ; then
  14. echo
  15. else
  16. sed -i -e "s/\"webrtc_revision\":.*,/\"webrtc_revision\": \"$1\",/" -e "s/\"libjingle_revision\":.*,/\"libjingle_revision\": \"$2\",/" trunk/DEPS
  17. gclient sync --force
  18. fi
  19. fi
  20. if [ $3 ] ; then
  21. echo "Updating from $3..."
  22. rm -rf trunk/third_party/webrtc
  23. mkdir trunk/src
  24. cp -a $3/webrtc/* trunk/src
  25. fi
  26. cd trunk
  27. export date=`date`
  28. export revision=`svnversion -n`
  29. if [ $1 ] ; then
  30. echo "WebRTC revision overridden from $revision to $1"
  31. export revision=$1
  32. else
  33. echo "WebRTC revision = $revision"
  34. fi
  35. cd ../../media/webrtc
  36. # safety - make it easy to find our way out of the forest
  37. hg tag -f -l old-tip
  38. # Ok, now we have a copy of the source. See what changed
  39. # (webrtc-import-last is a bookmark)
  40. # FIX! verify no changes in webrtc!
  41. hg update --clean webrtc-import-last
  42. rm -rf trunk
  43. mv ../../webrtc_update/trunk trunk
  44. mv -f ../../webrtc_update/.g* .
  45. rmdir ../../webrtc_update
  46. (hg addremove --exclude "**webrtcsessionobserver.h" --exclude "**webrtcjson.h" --exclude "**.svn" --exclude "**.git" --exclude "**.pyc" --exclude "**.yuv" --similarity 70 --dry-run trunk; hg status -m; echo "************* Please look at the filenames found by rename and see if they match!!! ***********" ) | less
  47. # FIX! Query user about add-removes better!!
  48. echo "Waiting 30 seconds - Hit ^C now to stop addremove and commit!"
  49. sleep 30 # let them ^C
  50. # Add/remove files, detect renames
  51. hg addremove --exclude "**webrtcsessionobserver.h" --exclude "**webrtcjson.h" --exclude "**.svn" --exclude "**.git" --exclude "**.pyc" --exclude "**.yuv" --similarity 70 trunk
  52. hg status -a -r >/tmp/changed_webrtc_files
  53. # leave this for the user for now until we're comfortable it works safely
  54. # Commit the vendor branch
  55. echo "Commit, merge and push to server - cut and paste"
  56. echo "You probably want to do these from another shell so you can look at these"
  57. hg commit -m "Webrtc import $revision"
  58. # webrtc-import-last is auto-updated (bookmark)
  59. #echo ""
  60. #hg update --clean webrtc-pending
  61. #hg merge -r webrtc-import-last
  62. #hg commit -m "merge latest import to pending, $revision"
  63. # webrtc-pending is auto-updated (bookmark)
  64. echo ""
  65. echo "hg update --clean webrtc-trim"
  66. echo "hg merge -r webrtc-import-last"
  67. echo "hg commit -m 'merge latest import to trim, $revision'"
  68. # webrtc-trim is auto-updated (bookmark)
  69. # commands to pull - never do more than echo them for the user
  70. echo ""
  71. echo "Here's how to pull this update into the mozilla repo:"
  72. echo "cd your_tree"
  73. echo "hg qpop -a"
  74. echo "hg pull --bookmark webrtc-trim path-to-webrtc-import-repo"
  75. echo "hg merge"
  76. echo "echo '#define WEBRTC_SVNVERSION $revision' >media/webrtc/webrtc_version.h"
  77. echo "echo '#define WEBRTC_PULL_DATE \"$date\"' >>media/webrtc/webrtc_version.h"
  78. echo "hg commit -m 'Webrtc updated to $revision; pull made on $date'"
  79. echo ""
  80. echo "Please check for added/removed/moved .gyp/.gypi files, and if so update EXTRA_CONFIG_DEPS in client.mk!"
  81. echo "possible gyp* file changes:"
  82. grep gyp /tmp/changed_webrtc_files
  83. echo ""
  84. echo "Once you feel safe:"
  85. echo "hg push"