media/webrtc/webrtc_update.sh

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial