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