|
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/. |
|
5 |
|
6 unpack_build () { |
|
7 unpack_platform="$1" |
|
8 dir_name="$2" |
|
9 pkg_file="$3" |
|
10 locale=$4 |
|
11 |
|
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 |
|
52 |
|
53 popd > /dev/null |
|
54 |
|
55 } |