]> git.donarmstrong.com Git - lilypond.git/commitdiff
* cygwin/mknetrel: Next try in building doc on Cygwin natively;
authorjanneke <janneke>
Sat, 27 Sep 2003 13:22:23 +0000 (13:22 +0000)
committerjanneke <janneke>
Sat, 27 Sep 2003 13:22:23 +0000 (13:22 +0000)
use addmakeflags again.

* cygwin/lily-wins.py (escape_shell): New function; use it.

* scripts/lilypond.py (escape_shell): Escape quotes and other
spaces too.  Do not escape escaping backslashes.

ChangeLog
cygwin/lily-wins.py
cygwin/mknetrel
scripts/lilypond.py

index 6fca1608efeb918af02d7544eca35fcb0c056499..5364b508239cdaf22b2313fd32fe32814efcd1bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-09-27  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * cygwin/mknetrel: Next try in building doc on Cygwin natively;
+       use addmakeflags again.
+
+       * cygwin/lily-wins.py (escape_shell): New function; use it.
+
+       * scripts/lilypond.py (escape_shell): Escape quotes and other
+       spaces too.  Do not escape escaping backslashes.
+
        * make/srcdir.make.in (web-install): Must call install-WWW now.
 
        * mf/GNUmakefile: resolve conflict: %list.ly is a target, not a
index 262fd3b9bc1a1cce0c28dd441eb3593adcc313b0..5612b0b6b03091832db4f74cd22adbf2cc794df7 100644 (file)
@@ -29,6 +29,10 @@ def strip_extension (f, ext):
                e = ''
        return p + e
 
+def escape_shell (x):
+       return re.sub (r'''([^\\])([`'"\\\s])''', r'\1\\\2', x)
+       # help emacs'" broken python mode
+       
 debug (`sys.argv`)
 
 if len (sys.argv) != 2 \
@@ -38,7 +42,7 @@ if len (sys.argv) != 2 \
        
 native_file = sys.argv[1]
        
-file = read_pipe ("/usr/bin/cygpath -au '%(native_file)s'" % vars ())
+file = read_pipe ('/usr/bin/cygpath -au %s' % escape_shell (native_file))
 if not file:
        file = native_file
 
@@ -51,12 +55,14 @@ base = os.path.basename (file)
 stem = strip_extension (base, '.ly')
 print `vars ()`
 
-native_base = read_pipe ('/usr/bin/cygpath -aw %(dir)s/%(stem)s' % vars ())
+native_base = '%(dir)s/%(stem)s' % vars ()
+native_base = read_pipe ('/usr/bin/cygpath -aw %s' % escape_shell (native_base))
+                        
 if not native_base:
        native_base = '%(dir)s/%(stem)s' % vars ()
 
 pdfname = read_pipe ('/usr/bin/regtool get /root/.pdf/')
-pdfopencommand = read_pipe ("/usr/bin/regtool get '/root/%(pdfname)s/shell/open/command/'" % vars ())
+pdfopencommand = read_pipe ('/usr/bin/regtool get /root/%s/shell/open/command/' % escape_shell (pdfname))
 
 # hmm
 native_view = re.sub ('"([^"]*).*"', '\\1', pdfopencommand)
@@ -64,16 +70,17 @@ if not native_view:
        native_view = 'acrobat'
        
 if native_view:
-       pdfview = read_pipe ("/usr/bin/cygpath -au '%(native_view)s'" % vars ())
+       pdfview = read_pipe ('/usr/bin/cygpath -au %s' % escape_shell (native_view))
 if not pdfview:
        # message box?
        sys.stderr.write ('no pdf viewer found\n')
        pdfview = 'xpdf'
 
 os.chdir (dir)
-system ("/usr/bin/lilypond '%(base)s' > '%(stem)s.log' 2>&1" % vars ())
+system ('/usr/bin/lilypond %s > %s.log 2>&1' % (escape_shell (base),
+                                               escape_shell (stem)))
 if not os.path.exists ('%(stem)s.pdf' % vars ()):
        # message box?
        sys.stderr.write ('pdf output not found\n')
 
-system ("'%(pdfview)s' '%(native_base)s.pdf'" % vars ())
+system ('%s %s.pdf' % (escape_shell (pdfview), escape_shell (native_base)))
index b054ec12e8ea497fc9fc3a968c058f121f62a30c..3bab9578029a9564c472831f42c5e97ee0f6b35d 100644 (file)
@@ -103,13 +103,14 @@ prebuild () {
        cp -pv mf/out-for-build/* mf/out
     fi
 
-    EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
-
     # set LDFLAGS to find the python library
-    # addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.dll" ' ' "target=i686-pc-cygwin" ' '
+    # EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
+
+    addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.dll" ' ' "target=i686-pc-cygwin" ' '
 
     if iscygwin; then
-       EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
+       # EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
+       addmakeflags all ' ' doc ' ' web ' '
     fi
 }
 
@@ -121,7 +122,8 @@ preinstall () {
 #      EXTRAINSTALLARGS="target=i686-pc-cygwin"
 #    else
     if iscygwin; then
-       EXTRAINSTALLARGS="web-install target=i686-pc-cygwin"
+       #EXTRAINSTALLARGS="web-install target=i686-pc-cygwin"
+       addmakeflags web-install
     fi
 }
 
index f75cb4c6240a438d9e89b245e1379f5895bc7275..681b8fa231b6cf2520e1acc4416547972b5d06ad 100644 (file)
@@ -233,12 +233,13 @@ def set_setting (dict, key, val):
                dict[key] = [val]
 
 
-def escape_path (x):
-       return re.sub ('([ \n\t\\\\])', r'\\\1',x)
+def escape_shell (x):
+       return re.sub (r'''([^\\])([`'"\\\s])''', r'\1\\\2', x)
+       # help emacs'" broken python mode
 
 def run_lilypond (files, dep_prefix):
        def make_include_option (x):
-               return '-I %s' %   escape_path (x)
+               return '-I %s' %   escape_shell (x)
 
        opts = ''
        opts = opts + ' ' + string.join (map (make_include_option, include_path))
@@ -258,7 +259,7 @@ def run_lilypond (files, dep_prefix):
                if dep_prefix:
                        opts = opts + ' --dep-prefix=%s' % dep_prefix
 
-       fs = string.join (map (escape_path, files))
+       fs = string.join (map (escape_shell, files))
 
        global verbose_p
        if verbose_p: