forked from SynologyOpenSource/pkgscripts-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSynoInstall
executable file
·96 lines (73 loc) · 1.5 KB
/
SynoInstall
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Copyright (c) 2000-2016 Synology Inc. All rights reserved.
. $(dirname `readlink -f "$0"`)/include/init
LANG=""
LC_ALL=""
Usage() {
cat << EOF
Usage
`basename $0` [OPTIONS] project_name+
Synopsis
Install projects.
Options
-p, --platform {platform}
Specify target platform.
-d, --with-debug
Install binaries with debug symbols.
-h, --help
This help message.
EOF
}
Source include/install
CheckPermission
ARGS=`getopt -u -l $DefaultLongArgs,enable-apt,single $DefaultArgs $@`
if [ $? -ne 0 ]; then
echo "You gave me option(s) that I do not know."
Usage
exit 1
fi
set -- $ARGS
ParsePkgInstallArgs() {
while [ -n "$1" ]; do
case "$1" in
"--enable-apt")
ENABLE_APT="yes"
;;
"--single")
# for backward compatibility
;;
*)
Error "Unhandled option '$1'"
Usage
exit 1
;;
esac
shift
done
}
main() {
local projectList=
local logFile=
local installFailed=N
ParseDefaultInstallArgs $@
ParsePkgInstallArgs $UnHandledOpt
SetupInstallEnv "$IsDebugBuild"
projectList=$(UnifyInstallProjects $InputProjs)
INFO "projectList=\"$projectList\""
for ThisProj in $projectList; do
logFile="$LogDir/$ThisProj.install"
[ -f "$logFile" ] && mv -f $logFile ${logFile}.old
(
INFO "Start to install ${ThisProj}."
SetupProjInstallEnv $ThisProj
InstallProject $ThisProj && CreateTarball $ThisProj
INFO "Install $ThisProj finished!"
) &> >(tee $logFile)
done
if ! CheckErrorLog install $projectList; then
return 1;
fi
INFO "Finished SynoInstall script."
return 0
}
main $@