a/trunk/cforge/cforge/Package/CFORGE/Scripts/cds_script.py | b/trunk/cforge/cforge/Package/CFORGE/Scripts/cds_script.py | ||
---|---|---|---|
... |
... |
||
72 | exitcode = p.ExitCode |
72 | exitcode = p.ExitCode |
73 | 73 | ||
74 | print("done: " + str(exitcode)) |
74 | print("done: " + str(exitcode)) |
75 | return exitcode |
75 | return exitcode |
76 | 76 | ||
77 | def RunPackageManager(args=None): |
||
78 | |||
79 | # common paths |
||
80 | workingdir = os.path.dirname(sys.argv[0]) |
||
81 | cdsdir = os.path.abspath(os.path.join(workingdir, os.path.pardir, os.path.pardir)) |
||
82 | #print(cdsdir) |
||
83 | |||
84 | # profile stuff |
||
85 | profiledir=os.path.join(cdsdir,"Profiles") |
||
86 | #print(profiledir) |
||
87 | lastprofile="" |
||
88 | for file in os.listdir(profiledir): |
||
89 | if file.endswith(".profile"): |
||
90 | lastprofile = file.replace(".profile","") |
||
91 | #print(lastprofile) |
||
92 | |||
93 | # exe |
||
94 | packageman_exe = os.path.join(cdsdir, "Common", "PackageManager.exe") |
||
95 | workdir = os.path.join(cdsdir, "Common") |
||
96 | exitcode = -1 |
||
97 | |||
98 | p = Process() |
||
99 | p.StartInfo.WorkingDirectory=workdir |
||
100 | p.StartInfo.FileName = packageman_exe |
||
101 | |||
102 | processargs = "--profile='" + lastprofile + "' " + args |
||
103 | |||
104 | print("running packman with args " + args) |
||
105 | p.StartInfo.Arguments = processargs |
||
106 | p.Start() |
||
107 | p.WaitForExit() |
||
108 | |||
109 | exitcode = p.ExitCode |
||
110 | |||
111 | print("done: " + str(exitcode)) |
||
112 | return exitcode |
||
113 | |||
114 | |||
115 | |||
116 | |||
77 | 117 |