-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpackage_zips.sh
executable file
·78 lines (70 loc) · 1.27 KB
/
package_zips.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
#
# package_zips.sh
#
#
# 2011 nubecoder
# http://www.nubecoder.com/
#
#defines
BINARY_PATH="$PWD/installer-zip/files/system/bin/"
#functions
SPACER()
{
echo "*"
}
START_SCRIPT()
{
TIME_START=$(date +%s)
echo "=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]"
}
SHOW_COMPLETED()
{
echo "Script completed."
TIME_END=$(date +%s)
echo "Total time: $(($TIME_END - $TIME_START)) seconds."
SPACER
echo "=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]=]"
exit
}
REMOVE_ZIP_BINARY()
{
rm -f "$BINARY_PATH/bash"
}
PREPARE_FOLDER()
{
REMOVE_ZIP_BINARY
cp "$PWD/$1" "$BINARY_PATH/bash"
}
CREATE_ZIP()
{
local T1=$(date +%s)
NAME="android_$1"
echo "Begin $NAME creation..."
PREPARE_FOLDER "$NAME"
OUTFILE=$PWD/$NAME"_installer.zip"
rm -fr "$OUTFILE"
MKZIP='7z -mx9 -mmt=1 a "$OUTFILE" .'
pushd "installer-zip" > /dev/null
eval "$MKZIP" > /dev/null
popd > /dev/null
local T2=$(date +%s)
echo "$NAME creation took $(($T2 - $T1)) seconds."
}
#main
START_SCRIPT
SPACER
echo "Packaging bash-3.2"
VERSION="bash-3.2.51(2)"
CREATE_ZIP "$VERSION"
SPACER
echo "Packaging bash-4.0"
VERSION="bash-4.0.38(2)"
CREATE_ZIP "$VERSION"
SPACER
echo "Packaging bash-4.1"
VERSION="bash-4.1.11(2)"
CREATE_ZIP "$VERSION"
SPACER
REMOVE_ZIP_BINARY
SHOW_COMPLETED