summaryrefslogtreecommitdiff
path: root/demoscript/Util.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-12-30 22:21:14 +0100
committerJose <jose@zeroc.com>2009-12-30 22:21:14 +0100
commit2f021f8cb8f0b948a42ff24d71c4ce5810e41eb4 (patch)
tree90e571363ff7699e844048f746dfde6f81709062 /demoscript/Util.py
parentMerge branch 'master' of ssh://git.zeroc.com/home/git/ice (diff)
downloadice-2f021f8cb8f0b948a42ff24d71c4ce5810e41eb4.tar.bz2
ice-2f021f8cb8f0b948a42ff24d71c4ce5810e41eb4.tar.xz
ice-2f021f8cb8f0b948a42ff24d71c4ce5810e41eb4.zip
4541 - Windows + demoscript + Ruby == not working?
Diffstat (limited to 'demoscript/Util.py')
-rw-r--r--demoscript/Util.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/demoscript/Util.py b/demoscript/Util.py
index f3c8806cf3a..144b57ab365 100644
--- a/demoscript/Util.py
+++ b/demoscript/Util.py
@@ -513,19 +513,26 @@ def getGlacier2Router():
else:
return "glacier2router"
-def spawn(command, cwd = None):
- desc = command.split(' ')[0]
+def spawn(command, cwd = None, mapping = None):
+ tokens = command.split(' ')
+ desc = tokens[0]
+ args = ""
+ for arg in tokens[1:len(tokens)]:
+ args += " " + arg
+
if defaultHost:
command = '%s %s' % (command, defaultHost)
+ args = '%s %s' % (args, defaultHost)
# magic
knownCommands = [ "icegridnode", "icegridregistry", "icebox", "iceboxd", "icegridadmin", "icestormadmin",
"iceboxadmin", "transformdb", "glacier2router" ]
- if desc in knownCommands:
- mapping = "cpp"
- else:
- mapping = getMapping()
+ if mapping == None:
+ if desc in knownCommands:
+ mapping = "cpp"
+ else:
+ mapping = getMapping()
if mapping == "cs":
if isMono():
@@ -541,12 +548,18 @@ def spawn(command, cwd = None):
command = command.replace("java", "java -Djava.net.preferIPv4Stack=true")
if isSolaris() and x64:
command = command.replace("java", "java -d64")
+ elif mapping == "cpp":
+ if cwd != None:
+ desc = os.path.join(cwd, desc)
+ if isWin32():
+ if not desc.endswith(".exe"):
+ desc += ".exe"
+ command = desc + " " + args
- if debug:
- print '(%s)' % (command)
if isWin32(): # Under Win32 ./ does not work.
command = command.replace("./", "")
-
+ if debug:
+ print '(%s)' % (command)
return Expect.Expect(command, logfile = tracefile, desc = desc, mapping = mapping, cwd = cwd)
def cleanDbDir(path):