-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.
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)
# 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)