The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit d46e595397e762de81ae39a41300f8ca8816c33d
Author: Enrico Forestieri <for...@lyx.org>
Date:   Tue Jan 1 03:58:33 2013 +0100

    Proper fix for #8477
    
    The "fix" in ec8ae50f was reintroducing #7718, #8098, and #8254.
    This fix is hopefully right while still avoiding code duplication.

diff --git a/lib/configure.py b/lib/configure.py
index c1584e5..26af8e3 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -56,9 +56,12 @@ def removeFiles(filenames):
             pass
 
 
-def cmdOutput(cmd):
+def cmdOutput(cmd, async = False):
     '''utility function: run a command and get its output as a string
         cmd: command to run
+        async: if False, return whole output as a string, otherwise
+               return the stdout handle from which the output can be
+               read (the caller is then responsible for closing it)
     '''
     if os.name == 'nt':
         b = False
@@ -68,6 +71,8 @@ def cmdOutput(cmd):
     pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
                             stdout=subprocess.PIPE, universal_newlines=True)
     pipe.stdin.close()
+    if async:
+        return pipe.stdout
     output = pipe.stdout.read()
     pipe.stdout.close()
     return output.strip()
@@ -1173,17 +1178,15 @@ def checkLatexConfig(check_config, bool_docbook):
     cl.close()
     #
     # we have chklayouts.tex, then process it
-    ret = 1
-    latex_out = os.popen(LATEX + ' wrap_chkconfig.ltx')
+    latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx', True)
     while True:
         line = latex_out.readline()
         if not line:
             break;
         if re.match('^\+', line):
             logger.info(line.strip())
-            # return None if the command succeeds
-            if line == "+Inspection done.":
-                ret = None
+    # if the command succeeds, None will be returned
+    ret = latex_out.close()
     #
     # remove the copied file
     if rmcopy:

-----------------------------------------------------------------------

Summary of changes:
 lib/configure.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to