-
Notifications
You must be signed in to change notification settings - Fork 15
/
release.sh
71 lines (55 loc) · 1.6 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
die(){
echo >&2 "$@"
exit 1
}
#check arguments here
#usage example: ./release.sh linux_flash_tool_v1.0
[ "$#" -gt 1 ] || die "more argument required, $# provided. Usage: $0 <release_name> <does_release(yes)>"
#release to Desktop by default.
release_dir=/release/public1/YuSu_BJ_Share/mtk81019_valid_before_20111231
qt_lib_dir=~/QtSDK/Desktop/Qt/473/gcc/lib
#check directory existence
echo "Qt library's location:"$qt_lib_dir
echo "tool release location:"$release_dir
if [ ! -d "$release_dir" ]; then
die "release location doesn't exit: "$release_dir
fi
if [ ! -d "$qt_lib_dir" ]; then
die "Qt library location doesn't exit: "$qt_lib_dir
fi
base=~/Desktop
dir=$base/$1
echo "releasing to "$dir
mkdir -p $dir
cp flash_tool $dir
cp *.bin $dir
#cp launch.sh $dir
cp image_map.xml $dir
cp usb_setting.xml $dir
cp console_mode.xsd $dir
cp -dupv libeboot.* $dir
cp -dupv libflashtool.* $dir
cp -dupv libusbfinder.* $dir
#qt dir includes libQtCore, libQtGui, libXmlPatterns
cp -dupv qt $dir -r
mkdir $dir/qt -p
cp -dupv $qt_lib_dir/libQtCore.so* $dir/qt
cp -dupv $qt_lib_dir/libQtGui.so* $dir/qt
cp -dupv $qt_lib_dir/libQtXmlPatterns.so* $dir/qt
cp -dupv $qt_lib_dir/libQtNetwork.so* $dir/qt
cp -dupv $qt_lib_dir/libQtXml.so* $dir/qt
echo "Notes:" > $dir/README.txt
echo "Remember to chmod a+x for all binaries." >>$dir/README.txt
#echo "2. execute launch.sh to start flash_tool." >>$dir/README.txt
pushd .
cd $base
tar -zcvf $base/$1.tar.gz $1
if [ "$2" == "yes" ]
then
echo "releasing to "$release_dir
cp $1.tar.gz $release_dir
fi
popd
#Done
echo "releasing done."