-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·77 lines (71 loc) · 1.92 KB
/
start.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
72
73
74
75
76
77
#!/bin/bash
function default_tools() {
repo sync --force-broken -j32
while [ $? == 1 ]; do
echo "======sync failed, re-sync again======"
repo sync --force-broken -j32
done
}
function kallop_tools() {
ALL_PKG=`grep project .repo/manifest.xml |awk '{print $3}' |cut -d'"' -f2`
ERR_PKG=""
RUN_ERR_PKG=`cat synchronization_tool/failed.pkg`
T_PKG=$ALL_PKG
while [ 1 ]
do
for i in $T_PKG
do
grep "$i" synchronization_tool/success.pkg >/dev/null 2>&1
if [ $? -eq 0 ]; then
continue
fi
repo sync $i -j32
if [ $? -ne 0 ];then
echo "sync error $i"
ERR_PKG="$ERR_PKG $i"
grep "$i" synchronization_tool/failed.pkg >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$i" >> synchronization_tool/failed.pkg
fi
continue
else
grep "$i" synchronization_tool/success.pkg >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$i" >> synchronization_tool/success.pkg
fi
echo "sync success $i"
fi
done
if [ "$ERR_PKG" = "" ];then
echo "sync done"
for i in $RUN_ERR_PKG
do
echo "$i"
done
exit 0
else
T_PKG=$ERR_PKG
ERR_PKG=""
fi
done
}
function choose_tools() {
echo ""
echo " Welcome to use Kallop Android synchronization tool"
echo ""
echo "1. use the default tools 2. use of new kallop tools"
echo "Q. quit"
echo ""
read -p "Please choose your way [1..2, Q] ? " i
case "$i" in
1)
default_tools;
;;
2)
kallop_tools;
;;
*)
exit 0
esac
}
choose_tools;