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.
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
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 \
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
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)
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)))
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
}
# 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
}
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))
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: