From 4b4c6622a8fad00e098e12e854de6d924988abf5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 4 Oct 2006 11:21:40 +0000 Subject: [PATCH] * python/lilylib.py (system): use os.system for mingw32 * scripts/lilypond-book.py (bindir): use os.pathsep for prepending to $PATH. --- ChangeLog | 8 ++++---- python/lilylib.py | 30 ++++++++++++++++++++++++++++++ scripts/lilypond-book.py | 2 +- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8403bdf940..e831e6d217 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,9 @@ -2006-10-04 Mats Bengtsson +2006-10-04 Han-Wen Nienhuys - * 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 + * scripts/lilypond-book.py (bindir): use os.pathsep for prepending + to $PATH. * scm/backend-library.scm: update email address. diff --git a/python/lilylib.py b/python/lilylib.py index e902feb134..9197d01f95 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -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) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 51c17e6b85..1442555d29 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -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) -- 2.39.2