]> git.donarmstrong.com Git - lilypond.git/commitdiff
* stepmake/aclocal.m4: revert version detection.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 May 2006 23:38:23 +0000 (23:38 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 May 2006 23:38:23 +0000 (23:38 +0000)
* buildscripts/output-distance.py
(ComparisonData.create_html_result_page): copy only if file
exists, fixup src paths.

* stepmake/bin/add-html-footer.py (built): junk gulp_file()

ChangeLog
GNUmakefile.in
buildscripts/output-distance.py
stepmake/aclocal.m4
stepmake/bin/add-html-footer.py

index b105c3313bc3f587d240b1b1af9b738a6297955b..41cd8012c4467c53ee3ed7b7e31e069c9a046994 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-06-01  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * stepmake/aclocal.m4: revert version detection.
+
+       * buildscripts/output-distance.py
+       (ComparisonData.create_html_result_page): copy only if file
+       exists, fixup src paths.
+
+       * stepmake/bin/add-html-footer.py (built): junk gulp_file()
+
 2006-06-01  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * stepmake/aclocal.m4: Robustification for (gcc) version detection.
index 417b8f10f42f3c2f3bd5b790247256e4a61549b4..bc9ae17ab0d77bcd276c3a2cdfd94d9d8b637f68 100644 (file)
@@ -72,13 +72,13 @@ local-WWW-post:
        echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
 
        cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
-       cd $(top-build-dir) && find . -name \*.html~ -print | xargs rm -f
 
 ## rewrite file names so we lose out-www
        -mv $(outdir)/web-root/ $(outdir)/old-web-root
        for d in out-www `cd $(top-build-dir) && find Documentation input -name 'out-www' `; do \
+               echo $$d ; \
                (mkdir -p $(outdir)/web-root/$$d/ || true) ; \
-               rsync -a --include source --include music-glossary \
+               rsync -Wa --include source --include music-glossary \
                        --include lilypond-internals  \
                        --include lilypond \
                $(foreach pat,$(web-ext), --include '*'.$(pat)) $(top-build-dir)/$$d/ $(outdir)/web-root/$$d/../ ; \
index e5f581c0b2ca397a0a31744816da49e2729ff923..1e25c1813a54ce17f0514036e4cd909ee2967a95 100644 (file)
@@ -244,7 +244,7 @@ class ComparisonData:
             f1 = dir1 +  '/' + p
             distance = compare_signature_files (f1, f2)
             self.result_dict[f2] = (distance, f1)
-    
+
     def create_text_result_page (self, dir1, dir2):
         self.write_text_result_page (dir2 + '/' + os.path.split (dir1)[1] + '.txt')
         
@@ -282,22 +282,29 @@ class ComparisonData:
 
         results.sort ()
         results.reverse ()
-
+        
         html = ''
         old_prefix = os.path.split (dir1)[1]
 
         dest_dir = os.path.join (dir2, old_prefix)
         shutil.rmtree  (dest_dir, ignore_errors=True)
         os.mkdir (dest_dir)
-        for (score, oldfile, newfile) in  results:
-            old_base = re.sub ("-[0-9]+.signature", '', os.path.split (oldfile)[1])
+        for (score, oldfile, newfile) in results:
+            
+            old_base = re.sub ("-[0-9]+.signature", '', oldfile)
+            old_name = os.path.split (old_base)[1]
             new_base = re.sub ("-[0-9]+.signature", '', newfile)
             
             for ext in 'png', 'ly':
-                shutil.copy2 (old_base + '.' + ext, dest_dir)
+                src_file = old_base + '.' + ext
+                
+                if os.path.exists (src_file):
+                    shutil.copy2 (src_file, dest_dir)
+                else:
+                    print "warning: can't find", src_file
 
-            img_1 = os.path.join (old_prefix, old_base + '.png')
-            ly_1 = os.path.join (old_prefix, old_base + '.ly')
+            img_1 = os.path.join (old_prefix, old_name + '.png')
+            ly_1 = os.path.join (old_prefix, old_name + '.ly')
 
             img_2 = new_base.replace (dir2, '') + '.png'
             img_2 = re.sub ("^/*", '', img_2)
@@ -345,11 +352,11 @@ class ComparisonData:
         
 
 def compare_trees (dir1, dir2):
-    data =  ComparisonData ()
+    data = ComparisonData ()
     data.compare_trees (dir1, dir2)
     data.print_results ()
     data.create_html_result_page (dir1, dir2)
-    data.create_text_result_page (dir1, dir2)
+#    data.create_text_result_page (dir1, dir2)
     
 ################################################################
 # TESTING
index 19b9200a40d4b696cb16f319afe7f18710209d7a..73cb599d53f7b80a2ef7ab8697489ff014ec785c 100644 (file)
@@ -32,8 +32,12 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
     ## FIXME: what systems still do not have $() in /bin/sh?
     eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' \
         | head -n 1 \
-        | sed -e 's/\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
-         -e 's/\([^0-9]*\|^\) //' -e 's/[^0-9]*$//'\`\"
+       | sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
+          -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\"
+
+## apparently breaks on darwin,  
+#              | sed -e 's/\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
+#        -e 's/\([^0-9]*\|^\) //' -e 's/[^0-9]*$//'\`\"
     if test -z "$_ver"; then
         ## If empty, try date [fontforge]
         eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\{6,8\}' \
index 1a5cbccfc013da265ef2edb6ebc60d5a4acd354b..7f2ef65dcd89e80edeb9a57bda163098e3baec3a 100644 (file)
@@ -47,7 +47,7 @@ default_footer = r"""<hr>Please take me <a href=@INDEX@>back to the index</a>
 of @PACKAGE_NAME@
 """
 
-built = r"""
+built = r'''
 <div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;">
 %(wiki_string)s
 <p>
@@ -58,23 +58,10 @@ This page is for %(package_name)s-%(package_version)s (%(branch_str)s). <br>
 Report errors to <a href="%(mail_address_url)s">%(mail_address)s</a>.</font></address>
 </p>
 </div>
-"""
+'''
+
 
 
-def gulp_file (f):
-    try:
-        i = open(f)
-        i.seek (0, 2)
-        n = i.tell ()
-        i.seek (0,0)
-    except:
-        sys.stderr.write ("can't open file: %s\n" % f)
-        return ''
-    s = i.read (n)
-    if len (s) <= 0:
-        sys.stderr.write ("gulped empty file: %s\n" % f)
-    i.close ()
-    return s
 
 def help ():
     sys.stdout.write (r"""Usage: add-html-footer [OPTIONS]... HTML-FILE
@@ -138,7 +125,7 @@ def set_gcos ():
 def compose (default, file):
     s = default
     if file:
-        s = gulp_file (file)
+        s = open (file).read ()
     return s
 
 set_gcos ()
@@ -200,7 +187,7 @@ def remove_self_ref (s):
     return s
 
 def do_file (f):
-    s = gulp_file (f)
+    s = open (f).read()
     s = re.sub ('%', '%%', s)