testing/release/common/unpack.sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial