]> git.donarmstrong.com Git - lilypond.git/commitdiff
* python/lilylib.py (system): use os.system for mingw32
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Oct 2006 11:21:40 +0000 (11:21 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Oct 2006 11:21:40 +0000 (11:21 +0000)
* scripts/lilypond-book.py (bindir): use os.pathsep for prepending
to $PATH.

ChangeLog
python/lilylib.py
scripts/lilypond-book.py

index 8403bdf94069ca10ea16324050758ec6c22d9991..e831e6d217206a27b85831def695135d76411626 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,9 @@
-2006-10-04  Mats Bengtsson  <mabe@drongo.s3.kth.se>
+2006-10-04  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
-       * scripts/lilypond-book.py (bindir): Use os.path.join to add the
-       path, in order to get correct path separators on all platforms.
+       * python/lilylib.py (system): use os.system for mingw32
 
-2006-10-04  Han-Wen Nienhuys  <hanwen@lilypond.org>
+       * scripts/lilypond-book.py (bindir): use os.pathsep for prepending
+       to $PATH.
 
        * scm/backend-library.scm: update email address.
 
index e902feb13404926dc2ea83cc81e0c1d15e210671..9197d01f95af98ebacbd8e6e2b7941038f5ad61e 100644 (file)
@@ -123,10 +123,40 @@ def subprocess_system (cmd,
 
     return abs (retval)
 
+def ossystem_system (cmd,
+                     ignore_error=False,
+                     progress_p=True,
+                     be_verbose=False,
+                     log_file=None):
+
+
+    if be_verbose:
+       show_progress = 1
+       progress (_ ("Invoking `%s\'") % cmd)
+    else:
+       progress ( _("Running %s...") % name)
+
+    retval = os.system (cmd)
+    if retval:
+       print >>sys.stderr, 'command failed:', cmd
+       if retval < 0:
+           print >>sys.stderr, "Child was terminated by signal", -retval
+       elif retval > 0:
+           print >>sys.stderr, "Child returned", retval
+
+       if ignore_error:
+           print >>sys.stderr, "Error ignored"
+       else:
+           sys.exit (1)
+
+    return abs (retval)
 
 
 system = subprocess_system
+if sys.platform == 'mingw32':
     
+    ## subprocess x-compile doesn't work.
+    system = ossystem_system
 
 def strip_extension (f, ext):
     (p, e) = os.path.splitext (f)
index 51c17e6b859373f64757cf30fcbbd53d88faf7b8..1442555d2971be104934f7472fc2b657016fc6c7 100644 (file)
@@ -48,7 +48,7 @@ for d in ['@lilypond_datadir@',
 # dynamic relocation, for GUB binaries.
 bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
 
-os.environ['PATH'] = os.path.join(bindir,os.environ['PATH'])
+os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
 for p in ['share', 'lib']:
     datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
     sys.path.insert (0, datadir)