]> git.donarmstrong.com Git - lilypond.git/blobdiff - bin/make-patch.py
release: 0.1.48
[lilypond.git] / bin / make-patch.py
index 047f8e37b7eacc7648e450fc3968259f7d5beecd..0f5ee3057dd588d794c50b7d8c60000863f15db9 100644 (file)
@@ -6,8 +6,10 @@ import os
 lilypath =''
 try:
     lilypath = os.environ['LILYPOND_SOURCEDIR'] + '/'
-except IndexError:
-    lilypath = os.environ['HOME'] + 'musix/current'
+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)
 
@@ -39,7 +41,7 @@ def help():
 
 def untar(fn):
     # os.system('pwd');
-    sys.stderr.write('untarring ' + fn)
+    sys.stderr.write('untarring ' + fn + '\n')
 # can't seem to fix errors:
 # gzip: stdout: Broken pipe
 # tar: Child returned status 1
@@ -48,7 +50,7 @@ def untar(fn):
 # 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.write('make-patch:ugh: Please ignore error: gzip: stdout: Broken pipe\n');
     sys.stderr.flush()
 
 
@@ -72,7 +74,12 @@ def remove_automatic(dirnames):
 def makepatch(fv, tv, patfile_nm):
     import tempfile
     prev_cwd = os.getcwd();
-    os.chdir ('/tmp')
+    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)])
@@ -91,7 +98,7 @@ def makepatch(fv, tv, patfile_nm):
     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')
+    os.chdir('/tmp/make-patch')
 
     sys.stderr.write('cleaning ... ')
     os.system('rm -fr %s %s' % (dirname(tv), dirname(fv)))
@@ -99,6 +106,7 @@ def makepatch(fv, tv, patfile_nm):
     os.chdir(prev_cwd)
     
 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='])