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 | #!/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 |
michael@0 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | |
michael@0 | 6 | unpack_build () { |
michael@0 | 7 | unpack_platform="$1" |
michael@0 | 8 | dir_name="$2" |
michael@0 | 9 | pkg_file="$3" |
michael@0 | 10 | locale=$4 |
michael@0 | 11 | |
michael@0 | 12 | mkdir -p $dir_name |
michael@0 | 13 | pushd $dir_name > /dev/null |
michael@0 | 14 | case $unpack_platform in |
michael@0 | 15 | mac|mac-ppc|Darwin_ppc-gcc|Darwin_Universal-gcc3) |
michael@0 | 16 | cd ../ |
michael@0 | 17 | mkdir -p mnt |
michael@0 | 18 | echo "mounting $pkg_file" |
michael@0 | 19 | echo "y" | PAGER="/bin/cat" hdiutil attach -quiet -puppetstrings -noautoopen -mountpoint ./mnt "$pkg_file" > /dev/null |
michael@0 | 20 | rsync -a ./mnt/* $dir_name/ |
michael@0 | 21 | hdiutil detach mnt > /dev/null |
michael@0 | 22 | cd $dir_name |
michael@0 | 23 | ;; |
michael@0 | 24 | win32|WINNT_x86-msvc) |
michael@0 | 25 | 7z x ../"$pkg_file" > /dev/null |
michael@0 | 26 | if [ -d core ] |
michael@0 | 27 | then |
michael@0 | 28 | mkdir bin/ |
michael@0 | 29 | cp -rp core/* bin/ |
michael@0 | 30 | cp -rp optional/* bin/ |
michael@0 | 31 | else |
michael@0 | 32 | for file in *.xpi |
michael@0 | 33 | do |
michael@0 | 34 | unzip -o $file > /dev/null |
michael@0 | 35 | done |
michael@0 | 36 | unzip -o ${locale}.xpi > /dev/null |
michael@0 | 37 | fi |
michael@0 | 38 | ;; |
michael@0 | 39 | linux-i686|linux|Linux_x86-gcc|Linux_x86-gcc3) |
michael@0 | 40 | if `echo $pkg_file | grep -q "tar.gz"` |
michael@0 | 41 | then |
michael@0 | 42 | tar xfz ../"$pkg_file" > /dev/null |
michael@0 | 43 | elif `echo $pkg_file | grep -q "tar.bz2"` |
michael@0 | 44 | then |
michael@0 | 45 | tar xfj ../"$pkg_file" > /dev/null |
michael@0 | 46 | else |
michael@0 | 47 | echo "Unknown package type for file: $pkg_file" |
michael@0 | 48 | exit 1 |
michael@0 | 49 | fi |
michael@0 | 50 | ;; |
michael@0 | 51 | esac |
michael@0 | 52 | |
michael@0 | 53 | popd > /dev/null |
michael@0 | 54 | |
michael@0 | 55 | } |