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