Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | check_updates () { |
michael@0 | 6 | # called with 4 args - platform, source package, target package, update package |
michael@0 | 7 | update_platform=$1 |
michael@0 | 8 | source_package=$2 |
michael@0 | 9 | target_package=$3 |
michael@0 | 10 | locale=$4 |
michael@0 | 11 | |
michael@0 | 12 | # cleanup |
michael@0 | 13 | rm -rf source/* |
michael@0 | 14 | rm -rf target/* |
michael@0 | 15 | |
michael@0 | 16 | unpack_build $update_platform source "$source_package" $locale |
michael@0 | 17 | if [ "$?" != "0" ]; then |
michael@0 | 18 | echo "FAILED: cannot unpack_build $update_platform source $source_package" |
michael@0 | 19 | return 1 |
michael@0 | 20 | fi |
michael@0 | 21 | unpack_build $update_platform target "$target_package" $locale |
michael@0 | 22 | if [ "$?" != "0" ]; then |
michael@0 | 23 | echo "FAILED: cannot unpack_build $update_platform target $target_package" |
michael@0 | 24 | return 1 |
michael@0 | 25 | fi |
michael@0 | 26 | |
michael@0 | 27 | case $update_platform in |
michael@0 | 28 | Darwin_ppc-gcc | Darwin_Universal-gcc3) |
michael@0 | 29 | platform_dirname="*.app" |
michael@0 | 30 | updater="Contents/MacOS/updater.app/Contents/MacOS/updater" |
michael@0 | 31 | ;; |
michael@0 | 32 | WINNT_x86-msvc) |
michael@0 | 33 | platform_dirname="bin" |
michael@0 | 34 | updater="updater.exe" |
michael@0 | 35 | ;; |
michael@0 | 36 | Linux_x86-gcc | Linux_x86-gcc3) |
michael@0 | 37 | platform_dirname=`echo $product | tr '[A-Z]' '[a-z]'` |
michael@0 | 38 | updater="updater" |
michael@0 | 39 | ;; |
michael@0 | 40 | esac |
michael@0 | 41 | |
michael@0 | 42 | if [ -f update/update.status ]; then rm update/update.status; fi |
michael@0 | 43 | if [ -f update/update.log ]; then rm update/update.log; fi |
michael@0 | 44 | |
michael@0 | 45 | if [ -d source/$platform_dirname ]; then |
michael@0 | 46 | cd source/$platform_dirname; |
michael@0 | 47 | cp $updater ../../update |
michael@0 | 48 | ../../update/updater ../../update 0 |
michael@0 | 49 | cd ../.. |
michael@0 | 50 | else |
michael@0 | 51 | echo "FAIL: no dir in source/$platform_dirname" |
michael@0 | 52 | return 1 |
michael@0 | 53 | fi |
michael@0 | 54 | |
michael@0 | 55 | cat update/update.log |
michael@0 | 56 | update_status=`cat update/update.status` |
michael@0 | 57 | |
michael@0 | 58 | if [ "$update_status" != "succeeded" ] |
michael@0 | 59 | then |
michael@0 | 60 | echo "FAIL: update status was not succeeded: $update_status" |
michael@0 | 61 | return 1 |
michael@0 | 62 | fi |
michael@0 | 63 | |
michael@0 | 64 | diff -r source/$platform_dirname target/$platform_dirname > results.diff |
michael@0 | 65 | diffErr=$? |
michael@0 | 66 | cat results.diff |
michael@0 | 67 | grep '^Binary files' results.diff > /dev/null |
michael@0 | 68 | grepErr=$? |
michael@0 | 69 | if [ $grepErr == 0 ] |
michael@0 | 70 | then |
michael@0 | 71 | echo "FAIL: binary files found in diff" |
michael@0 | 72 | return 1 |
michael@0 | 73 | elif [ $grepErr == 1 ] |
michael@0 | 74 | then |
michael@0 | 75 | if [ -s results.diff ] |
michael@0 | 76 | then |
michael@0 | 77 | echo "WARN: non-binary files found in diff" |
michael@0 | 78 | return 2 |
michael@0 | 79 | fi |
michael@0 | 80 | else |
michael@0 | 81 | echo "FAIL: unknown error from grep: $grepErr" |
michael@0 | 82 | return 3 |
michael@0 | 83 | fi |
michael@0 | 84 | if [ $diffErr != 0 ] |
michael@0 | 85 | then |
michael@0 | 86 | echo "FAIL: unknown error from diff: $diffErr" |
michael@0 | 87 | return 3 |
michael@0 | 88 | fi |
michael@0 | 89 | } |