]> git.donarmstrong.com Git - lilypond.git/blobdiff - bin/make-patch.py
release: 0.1.45
[lilypond.git] / bin / make-patch.py
index 30e870f16cd6a42302a51ad76d14f59b4c7b8796..6600ec2e7dbbbfb7788a110497b1234d64a1b5ef 100644 (file)
@@ -1,10 +1,25 @@
 #!@PYTHON@
+
+import sys
+import os
+
+lilypath =''
+try:
+    lilypath = 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)
+
+lilypath = lilypath + '/bin/'
+sys.path.append(lilypath)
+
+
 from lilypython import *
 import getopt
 import pipes
 
 
-mp_version = '2'
+mp_version = '0.3'
 
 class Options:
     def __init__(self):
@@ -48,45 +63,7 @@ usage \n\
 Patches do not contain automatically generated files, \n\
 i.e. you should rerun configure\n\n'
 
-import fnmatch
-import os
-
-_debug = 0
-
-_prune = ['(*)']
-
-
-def my_find(patterns, dir = os.curdir):
-        list = []
-        names = os.listdir(dir)
-        names.sort()
-        for name in names:
-                if name in (os.curdir, os.pardir):
-                        continue
-                fullname = os.path.join(dir, name)
-               for pat in patterns:
-                   if fnmatch.fnmatch(name, pat):
-                        list.append(fullname)
-                if os.path.isdir(fullname) and not os.path.islink(fullname):
-                        for p in _prune:
-                                if fnmatch.fnmatch(name, p):
-                                        if _debug: print "skip", `fullname`
-                                        break
-                        else:
-                                if _debug: print "descend into", `fullname`
-                               found = my_find(patterns, fullname)
-                               if found:
-                                   list = list + found
-        return list
-
-def multiple_find(pats, dirnames):
-    from find import find
-    l = []
-    for d in dirnames:
-       l = l + my_find(pats,  d)
-    return l
-
-pats = ['*.lsm', 'configure', '*.text', 'lilypond.spec']
+pats = ['*.lsm', 'configure', '*.txt', 'lilypond.spec']
 def remove_automatic(dirnames):
     files = []
     files = files + multiple_find(pats, dirnames)