1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/webrtc_update.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +#!/bin/bash 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 +# You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +# First, get a new copy of the tree to play with 1.10 +# They both want to be named 'trunk'... 1.11 +mkdir webrtc_update 1.12 +cd webrtc_update 1.13 + 1.14 +# Note: must be in trunk; won't work with --name (error during sync) 1.15 +gclient config --name trunk http://webrtc.googlecode.com/svn/trunk/peerconnection 1.16 +gclient sync --force 1.17 +if [ $2 ] ; then 1.18 +if [ $3 ] ; then 1.19 + echo 1.20 +else 1.21 + sed -i -e "s/\"webrtc_revision\":.*,/\"webrtc_revision\": \"$1\",/" -e "s/\"libjingle_revision\":.*,/\"libjingle_revision\": \"$2\",/" trunk/DEPS 1.22 + gclient sync --force 1.23 +fi 1.24 +fi 1.25 + 1.26 +if [ $3 ] ; then 1.27 +echo "Updating from $3..." 1.28 +rm -rf trunk/third_party/webrtc 1.29 +mkdir trunk/src 1.30 +cp -a $3/webrtc/* trunk/src 1.31 +fi 1.32 + 1.33 +cd trunk 1.34 + 1.35 +export date=`date` 1.36 +export revision=`svnversion -n` 1.37 +if [ $1 ] ; then 1.38 + echo "WebRTC revision overridden from $revision to $1" 1.39 + export revision=$1 1.40 +else 1.41 + echo "WebRTC revision = $revision" 1.42 +fi 1.43 + 1.44 +cd ../../media/webrtc 1.45 + 1.46 +# safety - make it easy to find our way out of the forest 1.47 +hg tag -f -l old-tip 1.48 + 1.49 +# Ok, now we have a copy of the source. See what changed 1.50 +# (webrtc-import-last is a bookmark) 1.51 +# FIX! verify no changes in webrtc! 1.52 +hg update --clean webrtc-import-last 1.53 + 1.54 +rm -rf trunk 1.55 +mv ../../webrtc_update/trunk trunk 1.56 +mv -f ../../webrtc_update/.g* . 1.57 +rmdir ../../webrtc_update 1.58 +(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 1.59 + 1.60 +# FIX! Query user about add-removes better!! 1.61 +echo "Waiting 30 seconds - Hit ^C now to stop addremove and commit!" 1.62 +sleep 30 # let them ^C 1.63 + 1.64 +# Add/remove files, detect renames 1.65 +hg addremove --exclude "**webrtcsessionobserver.h" --exclude "**webrtcjson.h" --exclude "**.svn" --exclude "**.git" --exclude "**.pyc" --exclude "**.yuv" --similarity 70 trunk 1.66 +hg status -a -r >/tmp/changed_webrtc_files 1.67 + 1.68 +# leave this for the user for now until we're comfortable it works safely 1.69 + 1.70 +# Commit the vendor branch 1.71 +echo "Commit, merge and push to server - cut and paste" 1.72 +echo "You probably want to do these from another shell so you can look at these" 1.73 +hg commit -m "Webrtc import $revision" 1.74 +# webrtc-import-last is auto-updated (bookmark) 1.75 + 1.76 +#echo "" 1.77 +#hg update --clean webrtc-pending 1.78 +#hg merge -r webrtc-import-last 1.79 +#hg commit -m "merge latest import to pending, $revision" 1.80 +# webrtc-pending is auto-updated (bookmark) 1.81 + 1.82 +echo "" 1.83 +echo "hg update --clean webrtc-trim" 1.84 +echo "hg merge -r webrtc-import-last" 1.85 +echo "hg commit -m 'merge latest import to trim, $revision'" 1.86 +# webrtc-trim is auto-updated (bookmark) 1.87 + 1.88 +# commands to pull - never do more than echo them for the user 1.89 +echo "" 1.90 +echo "Here's how to pull this update into the mozilla repo:" 1.91 +echo "cd your_tree" 1.92 +echo "hg qpop -a" 1.93 +echo "hg pull --bookmark webrtc-trim path-to-webrtc-import-repo" 1.94 +echo "hg merge" 1.95 +echo "echo '#define WEBRTC_SVNVERSION $revision' >media/webrtc/webrtc_version.h" 1.96 +echo "echo '#define WEBRTC_PULL_DATE \"$date\"' >>media/webrtc/webrtc_version.h" 1.97 +echo "hg commit -m 'Webrtc updated to $revision; pull made on $date'" 1.98 +echo "" 1.99 +echo "Please check for added/removed/moved .gyp/.gypi files, and if so update EXTRA_CONFIG_DEPS in client.mk!" 1.100 +echo "possible gyp* file changes:" 1.101 +grep gyp /tmp/changed_webrtc_files 1.102 +echo "" 1.103 +echo "Once you feel safe:" 1.104 +echo "hg push"