1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/testing/release/common/unpack.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +#!/bin/bash 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +unpack_build () { 1.10 + unpack_platform="$1" 1.11 + dir_name="$2" 1.12 + pkg_file="$3" 1.13 + locale=$4 1.14 + 1.15 + mkdir -p $dir_name 1.16 + pushd $dir_name > /dev/null 1.17 + case $unpack_platform in 1.18 + mac|mac-ppc|Darwin_ppc-gcc|Darwin_Universal-gcc3) 1.19 + cd ../ 1.20 + mkdir -p mnt 1.21 + echo "mounting $pkg_file" 1.22 + echo "y" | PAGER="/bin/cat" hdiutil attach -quiet -puppetstrings -noautoopen -mountpoint ./mnt "$pkg_file" > /dev/null 1.23 + rsync -a ./mnt/* $dir_name/ 1.24 + hdiutil detach mnt > /dev/null 1.25 + cd $dir_name 1.26 + ;; 1.27 + win32|WINNT_x86-msvc) 1.28 + 7z x ../"$pkg_file" > /dev/null 1.29 + if [ -d core ] 1.30 + then 1.31 + mkdir bin/ 1.32 + cp -rp core/* bin/ 1.33 + cp -rp optional/* bin/ 1.34 + else 1.35 + for file in *.xpi 1.36 + do 1.37 + unzip -o $file > /dev/null 1.38 + done 1.39 + unzip -o ${locale}.xpi > /dev/null 1.40 + fi 1.41 + ;; 1.42 + linux-i686|linux|Linux_x86-gcc|Linux_x86-gcc3) 1.43 + if `echo $pkg_file | grep -q "tar.gz"` 1.44 + then 1.45 + tar xfz ../"$pkg_file" > /dev/null 1.46 + elif `echo $pkg_file | grep -q "tar.bz2"` 1.47 + then 1.48 + tar xfj ../"$pkg_file" > /dev/null 1.49 + else 1.50 + echo "Unknown package type for file: $pkg_file" 1.51 + exit 1 1.52 + fi 1.53 + ;; 1.54 + esac 1.55 + 1.56 + popd > /dev/null 1.57 + 1.58 +}