]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/bin/package-diff.py
release: 1.1.0
[lilypond.git] / stepmake / bin / package-diff.py
index dfbbebc988e530b1afea9f9dbaabdf35e1bd51e7..e8e28f1bab676efebc02e66d0659792913fa7fd7 100644 (file)
@@ -35,7 +35,7 @@ def help ():
        sys.stdout.write (
                'Generate a patch to go to current version\n'
                '  -f, --from=FROM      old is FROM\n'
-               '  -h, --help           print this help\n'
+               '  -h, --help           print this help\n'
                '  -p, --package=DIR    specify package\n'
                '  -r, --release        diff against latest release\n'  
                '  -t, --to=TO          to version TO\n'  
@@ -54,9 +54,14 @@ def remove_automatic (dirnames):
        # urg, again?
        from flower import *
        files = files + multiple_find (pats, dirnames)
-
+       dirs = multiple_find (['out'], dirnames)
+       for d in dirs:
+               files = files + multiple_find (['*'], [d])
        for f in files:
-               os.remove (f)
+               try:
+                       os.remove (f)
+               except:
+                       sys.stderr.write ("can't remove: `" + f + "'\n'")
 
 def dirname (v):
        # urg, again?
@@ -77,8 +82,8 @@ def remove_configure (dir):
 
        # should do 'make distclean ?'
        os.system ('rm -rf debian/out')
-       os.system ('rm -f Makefile config.cache config.h config.hh config.log config.make config.status')
-       os.system ('rm -f stepmake/Makefile stepmake/config.hh stepmake/config.log stepmake/config.make')
+       os.system ('rm -f GNUmakefile config.cache config.h config.hh config.log config.make config.status configure')
+       os.system ('rm -f stepmake/GNUmakefile stepmake/config.hh stepmake/config.log stepmake/config.status stepmake/config.make')
 
        # ugh: symlinks
        os.system ('rm -f stepmake/stepmake/stepmake')
@@ -86,7 +91,7 @@ def remove_configure (dir):
 
 
 # ugh, how to get rid of .tex files generated by lily?
-pats = ['.dstreamrc', 'configure', '*.diff', '*.diff.gz', '*.lsm', '*.pyc', '*.spec', '*.txt']
+pats = ['configure', '*.diff', '*.diff.gz', '*.pyc',  '*.txt']
 
 header = 'Generated by %s using %s,\
 \nFrom = %s, To = %s\n\
@@ -106,7 +111,7 @@ def makediff (fromdir, todir, patch_name):
        from packagepython import *
 
        remove_automatic ([fromdir, todir])
-
+       
        # ugh
        remove_configure (fromdir)
        remove_configure (todir)
@@ -138,9 +143,10 @@ def makediff (fromdir, todir, patch_name):
        if i == -1:
                f.write (to_str + '\n')
        else:
-               i = i + len (version_tuple_to_str (flags.to_version)) + 1
+               i = i + len (version_tuple_to_str (flags.to_version))
                state_vec = state_vec[:i]
                f.write (state_vec)
+               f.write ('\n')
        f.write ('++state\n')
        f.close ()