+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.
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/../ ; \
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')
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)
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
## 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\}' \
of @PACKAGE_NAME@
"""
-built = r"""
+built = r'''
<div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;">
%(wiki_string)s
<p>
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
def compose (default, file):
s = default
if file:
- s = gulp_file (file)
+ s = open (file).read ()
return s
set_gcos ()
return s
def do_file (f):
- s = gulp_file (f)
+ s = open (f).read()
s = re.sub ('%', '%%', s)