From: fred Date: Sun, 24 Mar 2002 20:09:06 +0000 (+0000) Subject: lilypond-0.1.53 X-Git-Tag: release/1.5.59~3244 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6a20bf0cb22dc0059b5533d921e24bf33f1d4e8c;p=lilypond.git lilypond-0.1.53 --- diff --git a/VERSION b/VERSION index 03a63583e4..b4ef45ec97 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION=0 MINOR_VERSION=1 -PATCH_LEVEL=52 +PATCH_LEVEL=53 MY_PATCH_LEVEL= # now used as shell script in configure too diff --git a/bin/lilypython.py b/bin/lilypython.py index 19b8c26db2..4375c69d3e 100644 --- a/bin/lilypython.py +++ b/bin/lilypython.py @@ -19,8 +19,6 @@ import os import getopt - - version_re = regex.compile('\\version *\"\(.*\)\"') # now used as shell script in configure too! # make_assign_re = regex.compile('^\([A-Z_]*\) *= *\(.*\)$') @@ -56,13 +54,17 @@ def next_version(tup): def prev_version(tup): t = tup if t[3]: - return (tup[0], tup[1], tup[2], ''); + t3name = regsub.sub('[0-9]*$', '', t[3]) + t3level = atoi(regsub.sub('[^0-9]*', '', t[3])) + if t3level and t3level - 1 > 0: + return (tup[0], tup[1], tup[2], t3name + `t3level - 1`); + else: + return (tup[0], tup[1], tup[2], ''); elif t[2] == 0 : return (tup[0], tup[1] -1, tup[2], ''); else: return (tup[0], tup[1], tup[2] - 1, ''); - def dirname(v): return 'lilypond-' + version_tuple_to_str(v) @@ -72,7 +74,6 @@ def tarball(v): def released_tarball(v): return lilydirs.release_dir + tarball(v) - def tuple_to_list(tup): l=[] for x in tup: @@ -88,8 +89,6 @@ def version_str_to_tuple(str): return (atoi(t[0]), atoi(t[1]), atoi(t[2]), mypatch) - - def guess_mudela_version(filename): f = open (filename) lines = f.readlines() @@ -194,201 +193,3 @@ def read_mudela_header (fn): return dict - -#!/usr/bin/python - -# -# lily-python.py -- implement general LilyPond-wide python stuff -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997 Han-Wen Nienhuys -# - -import posix -import pwd -import regex -import regsub -from string import * -from flower import * -import sys -import os -import getopt - - - - -version_re = regex.compile('\\version *\"\(.*\)\"') -# now used as shell script in configure too! -# make_assign_re = regex.compile('^\([A-Z_]*\) *= *\(.*\)$') -make_assign_re = regex.compile('^\([A-Z_]*\)=\(.*\)$') - -def version_tuple(file): - lines = file.readlines() - - mi = pa = mj = 0 - mp = '' - - for l in lines: - if make_assign_re.search(l) <> -1: - nm = make_assign_re.group(1) - val = make_assign_re.group(2) -# if nm == 'TOPLEVEL_MAJOR_VERSION': - if nm == 'MAJOR_VERSION': - mj = atoi(val) -# elif nm == 'TOPLEVEL_MINOR_VERSION': - elif nm == 'MINOR_VERSION': - mi = atoi(val) -# elif nm == 'TOPLEVEL_PATCH_LEVEL': - elif nm == 'PATCH_LEVEL': - pa = atoi(val) -# elif nm == 'TOPLEVEL_MY_PATCH_LEVEL': - elif nm == 'MY_PATCH_LEVEL': - mp = val - return (mj,mi,pa,mp) - -def next_version(tup): - return (tup[0], tup[1], tup[2] + 1, tup[3]); - -def prev_version(tup): - t = tup - if t[3]: - return (tup[0], tup[1], tup[2], ''); - elif t[2] == 0 : - return (tup[0], tup[1] -1, tup[2], ''); - else: - return (tup[0], tup[1], tup[2] - 1, ''); - - -def dirname(v): - return 'lilypond-' + version_tuple_to_str(v) - -def tarball(v): - return dirname(v) + '.tar.gz' - -def released_tarball(v): - return lilydirs.release_dir + tarball(v) - - -def tuple_to_list(tup): - l=[] - for x in tup: - l.append[x] - return l - -def version_str_to_tuple(str): - t = split(str, '.') - try: - mypatch = t[3] - except IndexError: - mypatch = '' - - return (atoi(t[0]), atoi(t[1]), atoi(t[2]), mypatch) - - - -def guess_mudela_version(filename): - f = open (filename) - lines = f.readlines() - f.close() - for l in lines: - if version_re.search(l) <> -1: - return version_re.group(1) - - return '' - -def version_tuple_to_str(tup): - mypatch ='' - if tup[3]: - mypatch = '.' + tup[3] - - return ('%d.%d.%d' % tup[0:3]) + mypatch - -class Lilydirs: - def __init__(self): - try: - self.topdir = os.environ['LILYPOND_SOURCEDIR'] + '/' - - except KeyError: - print 'Please set LILYPOND_SOURCEDIR to the toplevel source, eg LILYPOND_SOURCEDIR=/home/foobar/lilypond-1.2.3/' - sys.exit(1) - - try: - self.groupdir = os.environ['LILYPOND_GROUPDIR'] + '/' - except KeyError: - self.groupdir = self.topdir + '../' - - self.release_dir = self.groupdir + '/releases/' - self.patch_dir = self.groupdir + '/patches/' - - def version_tuple(self): - f = open (self.topdir + 'VERSION') - v = version_tuple(f) - f.close () - return v - - - -lilydirs = Lilydirs() - -if __name__ == '__main__': - v= lilydirs.version_tuple() - print v, prev_version(v), next_version(v) - mv = guess_mudela_version(lilydirs.topdir + 'init/symbol.ly') - pv=(0,1,1,'jcn4') - print version_tuple_to_str(pv), prev_version(pv), next_version(pv) - print version_tuple_to_str((0,1,1,'')) - print mv, version_str_to_tuple(mv) - - - -def dump_file(f, s): - i = open(f, 'w') - i.write(s) - i.close () - -def gulp_file(f): - i = open(f) - i.seek (0, 2) - len = i.tell () - i.seek (0,0) - return i.read (len) - - -header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}') -header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;') - -# -# FIXME breaks on multiple strings. -# -def read_mudela_header (fn): - s = gulp_file(fn) - s = regsub.gsub('%.*$', '', s) - s = regsub.gsub('\n', ' ', s) - - dict = {} - if header_regex.search(s) <> -1: - h = header_regex.group(1) - else: - return dict - - while regex.search('=', h) <> -1: - - if header_entry_regex.search (h) == -1: - - raise 'format error' - - h = regsub.sub(header_entry_regex, '', h) - left = header_entry_regex.group(1) - right = header_entry_regex.group(2) - - right = regsub.gsub('\([^\\]\)\"', '\\1', right) - right = regsub.gsub('^"', '', right) - left = regsub.gsub('\([^\\]\)\"', '', left) - left = regsub.gsub('^"', '', left) - - dict[left] = right - - return dict - - diff --git a/bin/make-patch.in b/bin/make-patch.in index 5d052f95f7..a2cbd77e7d 100644 --- a/bin/make-patch.in +++ b/bin/make-patch.in @@ -19,7 +19,7 @@ import getopt import pipes -mp_version = '0.3' +mp_version = '0.5' class Options: def __init__(self): @@ -34,7 +34,7 @@ def help(): 'Generate a patch to go to this version.\n' ' --from=FROM, -f FROM old is FROM\n' ' --to=TO, -t TO to version TO\n' - + ' --dir=DIR, -d TO directory\n' ) @@ -42,15 +42,7 @@ def help(): def untar(fn): # os.system('pwd'); sys.stderr.write('untarring ' + fn + '\n') -# can't seem to fix errors: -# gzip: stdout: Broken pipe -# tar: Child returned status 1 -# os.system ('tar xzf ' + fn) -# sys.stderr.write('\n') -# ugh, even this does not work, but one error message less :-) os.system ('gzip --quiet -dc ' + fn + '| tar xf - ') -# so print soothing message: -# sys.stderr.write('make-patch:ugh: Please ignore error: gzip: stdout: Broken pipe\n'); sys.stderr.flush() @@ -63,7 +55,9 @@ usage \n\ Patches do not contain automatically generated files, \n\ i.e. you should rerun configure\n\n' -pats = ['*.lsm', 'configure', '*.txt', 'lilypond.spec', 'Makefile.am', 'Makefile.in', 'lexer.cc', 'parser.cc'] +# ugh, how to get rid of .tex files generated by lily? +pats = ['core', '*.lsm', 'configure', '*.P', '*.txt', 'feta[0-9][0-9]*.ly', 'feta[0-9][0-9]*.tex', '*.orig', '*.rej', '*bla*', 'x', '*.dvi', '*.aux', '*.log', '*.ps', '*.gif', '*.midi', 'lilypond.spec', 'Makefile.am', 'Makefile.in', 'lexer.cc', 'parser.cc', 'patch-*'] + def remove_automatic(dirnames): files = [] files = files + multiple_find(pats, dirnames) @@ -71,53 +65,44 @@ def remove_automatic(dirnames): for f in files: os.remove(f) -def makepatch(fv, tv, patfile_nm): - import tempfile - prev_cwd = os.getcwd(); - try: - os.mkdir ('/tmp/make-patch'); - except: - pass - - os.chdir ('/tmp/make-patch'); - untar(released_tarball(fv)) - untar(released_tarball(tv)) - remove_automatic([dirname(fv), dirname(tv)]) +def makepatch(fromdir, todir, patfile_nm): - os.chdir(dirname(tv)) - - if not patfile_nm: - patfile_nm = '../patch-%s' % version_tuple_to_str(tv) + remove_automatic([fromdir, todir]) + os.chdir(todir) + f = open(patfile_nm, 'w') f.write(header %\ - (version_tuple_to_str(fv), version_tuple_to_str(tv), \ + (fromdir, todir, \ os.path.basename(patfile_nm))) f.close() sys.stderr.write('diffing to %s... ' % patfile_nm) - os.system('diff -urN ../%s . >> %s' % (dirname(fv), patfile_nm)) - #os.system('gzip -9f %s' % patfile_nm) - os.chdir('/tmp/make-patch') - - sys.stderr.write('cleaning ... ') - os.system('rm -fr %s %s' % (dirname(tv), dirname(fv))) - sys.stderr.write('\n') - os.chdir(prev_cwd) - + os.system('pwd') + print ('diff -urN ../%s . >> %s' % (fromdir, patfile_nm)) + os.system('diff -urN ../%s . >> %s' % (fromdir, patfile_nm)) + os.system('gzip -9f %s' % patfile_nm) + def main(): os.environ['GZIP'] = '-q' sys.stderr.write('This is make-patch version %s\n' % mp_version) (cl_options, files) = getopt.getopt(sys.argv[1:], 'hf:o:t:', ['output=', 'help', 'from=', 'to=']) outfn = '' + srcdir = './' + from_b=0 + to_b=0 for opt in cl_options: o = opt[0] a = opt[1] if o == '--from' or o == '-f': options.from_version = version_str_to_tuple(a) + from_b=1 elif o == '--to' or o == '-t': - options.to_version = version_str_to_tuple(a) + options.to_version = version_str_to_tuple(a) + to_b=1 + elif o == '--dir' or o == '-d': + srcdir = a; elif o== '--help' or o == '-h': help() return 0; @@ -130,7 +115,54 @@ def main(): pn = 'patch-%s' % version_tuple_to_str(options.to_version) outfn = os.path.join(os.getcwd(), pn) - makepatch(options.from_version, options.to_version, outfn) + import tempfile + prev_cwd = os.getcwd(); + + os.system('rm -rf /tmp/make-patch') + try: + os.mkdir ('/tmp/make-patch') + except: + pass + + fromdir = dirname(options.from_version) + todir = dirname(options.to_version) + + diffdir = '' + # always true, for now + if srcdir != '': + diffdir = '/tmp/make-patch/' + 'lilypond-%s'\ + % version_tuple_to_str(options.to_version) + + if from_b != 0 or (from_b == 0 and to_b == 0): + os.chdir ('/tmp/make-patch') + untar(released_tarball(options.from_version)) + os.chdir(prev_cwd) + else: + fromdir = diffdir + sys.stderr.write('copying ' + srcdir + ' to ' + diffdir + '\n') + os.system('cp -pr %s %s' % (srcdir, diffdir)) + + if to_b != 0: + os.chdir ('/tmp/make-patch') + untar(released_tarball(options.to_version)) + os.chdir(prev_cwd) + else: + todir = diffdir + sys.stderr.write('copying ' + srcdir + ' to ' + diffdir + '\n') + os.system('cp -pr %s %s' % (srcdir, diffdir)) + + os.chdir(diffdir) + os.system('rm -f *.aux *.dvi *.midi *.log *.ps *.tex *.ly') + os.chdir ('/tmp/make-patch') + + makepatch(fromdir, todir, outfn) + + os.chdir('/tmp/make-patch') + sys.stderr.write('cleaning ... ') + os.system('rm -fr %s %s' % (fromdir, todir)) + sys.stderr.write('\n') + os.chdir(prev_cwd) if __name__ == '__main__': main() + diff --git a/flowertest/Makefile.am b/flowertest/Makefile.am new file mode 100644 index 0000000000..6f8250cf71 --- /dev/null +++ b/flowertest/Makefile.am @@ -0,0 +1,27 @@ +# Generated automatically by wild-perl 0.1 +# project LilyPond -- the musical typesetter +# title makefile for flowertest +# file flowertest/Makefile.am.wild + +bin_PROGRAMS = test + +TESTS = $(top_srcdir)/flowertest/check.sh + +test_SOURCES = + +test_LDADD = $(top_builddir)/flower/libflower.la @LEXLIB@ + +EXTRA_DIST = result Makefile.am.wild GNUmakefile check.sh + +noinst_HEADERS = + +INCLUDES = -I$(top_srcdir)/flower/include + +# override default target for all-am: to get an extra dependency +all-am: Makefile $(PROGRAMS) wild-check + +# dummy target for non-GNU makes; is overridden in GNUmakefile +wild-check: + +$(srcdir)/Makefile.am: $(srcdir)/Makefile.am.wild + $(PERL) $(top_srcdir)/bin/wild-perl < $< > $@ \ No newline at end of file diff --git a/flowertest/Makefile.am.wild b/flowertest/Makefile.am.wild new file mode 100644 index 0000000000..abbf5ddfd8 --- /dev/null +++ b/flowertest/Makefile.am.wild @@ -0,0 +1,24 @@ +# project LilyPond -- the musical typesetter +# title makefile for flowertest +# file flowertest/Makefile.am.wild + +bin_PROGRAMS = test + +TESTS = $(top_srcdir)/flowertest/check.sh + +test_SOURCES = $(wildcard *.cc) + +test_LDADD = $(top_builddir)/flower/libflower.la @LEXLIB@ + +EXTRA_DIST = result Makefile.am.wild GNUmakefile check.sh + +noinst_HEADERS = $(wildcard *.hh) + +INCLUDES = -I$(top_srcdir)/flower/include + +# override default target for all-am: to get an extra dependency +all-am: Makefile $(PROGRAMS) wild-check + +# dummy target for non-GNU makes; is overridden in GNUmakefile +wild-check: + diff --git a/flowertest/check.sh b/flowertest/check.sh new file mode 100644 index 0000000000..31406738de --- /dev/null +++ b/flowertest/check.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +./test > result.test +# ugh +cmp result.test $LILYPOND_SOURCEDIR/flowertest/result +exit $? +