Title: [commits] (bear) [15987] added option to allow createTranslations to force
Revision
15987
Author
bear
Date
2007-11-30 13:05:02 -0800 (Fri, 30 Nov 2007)

Log Message

added option to allow createTranslations to force
runCommand() to not use preexec_fn

Modified Paths

Diff

Modified: trunk/chandler/tools/build_lib.py (15986 => 15987)

--- trunk/chandler/tools/build_lib.py	2007-11-30 20:43:53 UTC (rev 15986)
+++ trunk/chandler/tools/build_lib.py	2007-11-30 21:05:02 UTC (rev 15987)
@@ -80,7 +80,7 @@
     os.setpgid(0, 0)
 
 
-def runCommand(cmd, env=None, timeout=-1, logger=log):
+def runCommand(cmd, env=None, timeout=-1, logger=log, ignorepreexec=False):
     """
     Execute the given command and log all output
 
@@ -127,10 +127,15 @@
         else:
             output = tempfile.TemporaryFile()
 
+    if ignorepreexec:
+        preexec_fn = None
+    else:
+        preexec_fn = setpgid_preexec_fn
+
     if redirect:
-        p = killableprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, stdout=output, stderr=subprocess.STDOUT, preexec_fn=setpgid_preexec_fn)
+        p = killableprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, stdout=output, stderr=subprocess.STDOUT, preexec_fn=preexec_fn)
     else:
-        p = killableprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, preexec_fn=setpgid_preexec_fn)
+        p = killableprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, preexec_fn=preexec_fn)
 
     try:
         if timeout == -1 and redirect:

Modified: trunk/chandler/tools/createTranslationEgg.py (15986 => 15987)

--- trunk/chandler/tools/createTranslationEgg.py	2007-11-30 20:43:53 UTC (rev 15986)
+++ trunk/chandler/tools/createTranslationEgg.py	2007-11-30 21:05:02 UTC (rev 15987)
@@ -36,7 +36,7 @@
     pass
 
 try:
-    build_lib.runCommand("msgfmt", timeout=5, logger=ignore)
+    build_lib.runCommand("msgfmt", timeout=5, logger=ignore, ignorepreexec=True)
     MSGFMT_INSTALLED = True
 except:
     MSGFMT_INSTALLED = False
@@ -254,7 +254,7 @@
                 msgfmt = os.path.join(self.CHANDLERHOME, "tools", "msgfmt.py")
                 exp = [self.PYTHON,  msgfmt, self.POFILE]
 
-            result = build_lib.runCommand(exp, timeout=60, logger=ignore)
+            result = build_lib.runCommand(exp, timeout=60, logger=ignore, ignorepreexec=True)
             os.chdir(cwd)
 
             if result != 0:
@@ -265,7 +265,7 @@
 
     def createEggInfoDir(self):
         exp = [self.PYTHON, 'setup.py', 'egg_info']
-        result = build_lib.runCommand(exp, timeout=60, logger=ignore)
+        result = build_lib.runCommand(exp, timeout=60, logger=ignore, ignorepreexec=True)
 
         if result != 0:
             self.raiseError(' '.join(exp) + ' failed with error code %d' % result)
@@ -282,13 +282,13 @@
 
     def putEggInDevelopMode(self):
         exp = [self.PYTHON, "setup.py", "develop", "-x", "--install-dir=%s" % self.CHANDLERHOME]
-        result = build_lib.runCommand(exp, timeout=60, logger=ignore)
+        result = build_lib.runCommand(exp, timeout=60, logger=ignore, ignorepreexec=True)
         if result != 0:
             self.raiseError(' '.join(exp) + ' failed with error code %d' % result)
 
     def packageEggForDistribution(self):
         exp = [self.PYTHON, "setup.py", "bdist_egg"]
-        result = build_lib.runCommand(exp, timeout=60, logger=ignore)
+        result = build_lib.runCommand(exp, timeout=60, logger=ignore, ignorepreexec=True)
         if result != 0:
             self.raiseError(' '.join(exp) + ' failed with error code %d' % result)
 




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to