-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyServiceAgent.py
More file actions
executable file
·68 lines (55 loc) · 1.85 KB
/
CopyServiceAgent.py
File metadata and controls
executable file
·68 lines (55 loc) · 1.85 KB
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
#!/usr/bin/env python
import os
import sys
import subprocess
import shutil
from pylib.print_color import *
PAPYRUSRT = "obigo-sdk/Papyrus-RT/papyrusrt"
SA_FOLDER = "SA"
CDT_PROJECT = "ServiceAgent_CDTProject"
BINARY_NAME = "ServiceAgent_CDTProject"
INSTALL_FOLDER = "ServiceAgentBM"
CLONE_FOLDER = "serviceagent-bm"
CLONE_FOLDER_SA = "serviceagent"
BUILD_FOLDER = "build"
PACKAGE_FOLDER = "package"
CONFIGURATION = ''
PLATFORM = ''
CWD = os.path.dirname(os.path.realpath(__file__))
os.chdir(CWD)
def checkPath(path, exist):
if exist == True:
if os.path.exists(path) == False:
printfail(path + " doesn't exist")
sys.exit()
else:
return
if exist == False:
if os.path.exists(path) == True:
printfail(path + " already exist")
sys.exit()
else:
return
if len(sys.argv) < 2:
message = __file__ + " <Configuration Name>"
printfail(message)
sys.exit()
CONFIGURATION = sys.argv[1]
binaryfile = os.path.join(CWD, INSTALL_FOLDER, CLONE_FOLDER, CLONE_FOLDER_SA,
SA_FOLDER, CDT_PROJECT, CONFIGURATION, BINARY_NAME)
printheader("##########################################################")
printheader("### Looking for the binary file : ")
printheader("### " + binaryfile)
printheader("##########################################################")
checkPath(binaryfile, True)
targetfile = ''
if CONFIGURATION == 'Debug':
targetfile = os.path.join(CWD, INSTALL_FOLDER, CLONE_FOLDER, BUILD_FOLDER, PACKAGE_FOLDER, 'x86_64', 'bin/sa-service')
else:
targetfile = os.path.join(CWD, INSTALL_FOLDER, CLONE_FOLDER, BUILD_FOLDER, PACKAGE_FOLDER, 'armv7-a', 'bin/sa-service')
printheader("##########################################################")
printheader("### Copying the binary file to ")
printheader("### " + targetfile)
printheader("##########################################################")
checkPath(targetfile, True)
shutil.copyfile(binaryfile, targetfile)