]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add autogenerated markers (issue 847).
authorJulien Rioux <jrioux@physics.utoronto.ca>
Sat, 13 Oct 2012 17:33:40 +0000 (13:33 -0400)
committerJulien Rioux <jrioux@physics.utoronto.ca>
Thu, 18 Oct 2012 06:48:39 +0000 (02:48 -0400)
Add autogenerated markers to files produced from build scripts.

Also fix some typos and help message from scripts.

python/auxiliar/postprocess_html.py
scripts/build/bib2texi.py
scripts/build/create-version-itexi.py
scripts/build/create-weblinks-itexi.py
scripts/build/lys-to-tely.py
scripts/build/output-distance.py
scripts/build/website_post.py
scripts/build/www_post.py

index fd254b5a08411acf4abbb668dcd05b9c710d760a..538f79a7988d8142241fd8124e79db6c95b4370e 100644 (file)
@@ -6,6 +6,7 @@ add footer, tweak links, add language selection menu.
 """
 import re
 import os
+import sys
 import time
 import operator
 
@@ -37,19 +38,21 @@ header = r"""
 
 footer = '''
 <div class="footer">
+<!-- This footer was autogenerated by %s -->
 <p class="footer_version">
-%(footer_name_version)s
+%%(footer_name_version)s
 </p>
 <p class="footer_report">
-%(footer_report_links)s
+%%(footer_report_links)s
 </p>
 </div>
-'''
+''' % sys.argv[0]
 
 web_footer = '''
 <div class="footer">
+<!-- This footer was autogenerated by %s -->
 </div>
-'''
+''' % sys.argv[0]
 
 footer_name_version = _doc ('This page is for %(package_name)s-%(package_version)s (%(branch_str)s).')
 # ugh, must not have "_doc" in strings because it is naively replaced with "_" in hacked gettext process
@@ -71,11 +74,12 @@ browser_language_url = "http://www.lilypond.org/website/misc/browser-language"
 
 LANGUAGES_TEMPLATE = '''
 <p id="languages">
- %(language_available)s
+<!-- These links were autogenerated by %s -->
+ %%(language_available)s
  <br>
- %(browser_language)s
+ %%(browser_language)s
 </p>
-'''
+''' % sys.argv[0]
 
 
 html_re = re.compile ('(.*?)(?:[.]([^/.]*))?[.]html$')
index c71976dec123f64b50457d055ffa45dd6f5aa14a..b76a171a09263bd64c9ba1970a1b0439845aa3ac 100644 (file)
@@ -6,7 +6,7 @@ import tempfile
 
 # usage:
 def usage ():
-    print 'usage: %s [-s style] [-o <outfile>] [-q] BIBFILES...'
+    print 'usage: bib2texi.py [-s style] [-o <outfile>] [-q] BIBFILES...'
     print '-q suppresses most output'
 
 (options, files) = getopt.getopt (sys.argv[1:], 's:o:hq', [])
@@ -32,6 +32,11 @@ if not files:
    usage ()
    sys.exit (2)
 
+marker = """@c This file was autogenerated
+@c     from: %s
+@c     by:   %s
+
+""" % (", ".join(files), sys.argv[0])
 
 def strip_extension (f, ext):
     (p, e) = os.path.splitext (f)
@@ -84,7 +89,10 @@ if bbl.strip () == '':
     sys.stderr.write ("Bibtex generated an empty file!")
     sys.exit (1)
 
-open (output, 'w').write  (bbl)
+fout = open (output, 'w')
+fout.write (marker)
+fout.write (bbl)
+fout.close ()
 
 def cleanup (tmpfile):
     for a in ['aux','bbl', 'blg']:
index e40ff6e79b0868c210c83b24089ba2347b1965ca..f4dc066fccc6c762fb3cf4981b3a1c9a13d96217 100644 (file)
@@ -66,9 +66,15 @@ def make_macro(name, string):
     print "@end macro"
     print ""
 
+print "@c This file was autogenerated"
+print "@c     from: VERSION"
+print "@c     by:   %s" % sys.argv[0]
+print ""
 print "@c ************************ Version numbers ************"
+print ""
+
 make_macro("version", VERSION)
 make_macro("versionStable", VERSION_STABLE)
 make_macro("versionDevel", VERSION_DEVEL)
 
-
+print "@c *****************************************************"
index 703b4c80e9e7d652f4c2380cfd01b4697b1f70e8..cb785b43a0ae28e51edf09d8d3381086b8f9eae3 100644 (file)
@@ -1,6 +1,6 @@
 #!@PYTHON@
 # -*- coding: utf-8 -*-
-# create-version-itexi.py
+# create-weblinks-itexi.py
 
 """ when being called on lilypond.org, pass it the location of the
 top source dir on the command-line. """
@@ -338,7 +338,9 @@ def make_download(name, osA, osB, version, revision, text):
     string += "}"
     make_macro(name, string)
 
-def make_download_source(name, vstring, version, lang):
+def make_download_source(name, version, lang):
+    assert "." in version
+    vstring = "v%s.%s" % tuple(version.split(".", 2)[0:2])
     string = "@uref{http://download.linuxaudio.org/lilypond/sources/"
     string += vstring + "/"
     string += "lilypond-" + version + ".tar.gz"
@@ -520,30 +522,40 @@ def make_doctarball_links(name, version, lang):
     make_ver_link(macroLang("doctarball"+name, lang),
         url, getTrans("Doc tarball for ", lang)+version)
 
+print "@c This file was autogenerated"
+print "@c     from: VERSION"
+print "@c     by:   %s" % sys.argv[0]
+print ""
 print "@c ************************ Download binaries ************"
+print ""
+
 make_all_downloads("Stable", VERSION_STABLE)
 make_all_downloads("Devel", VERSION_DEVEL)
 
 print "@c ************************ Download source ************"
-# FIXME: icky hard-coding!  -gp
+print ""
+
 for lang in langs:
-    print "@c *********", lang, "***"
-    make_download_source("downloadStableSource","v2.16",VERSION_STABLE,lang)
-    make_download_source("downloadDevelSource","v2.17",VERSION_DEVEL,lang)
+    print "@c *********", lang or "en", "***"
+    make_download_source("downloadStableSource", VERSION_STABLE, lang)
+    make_download_source("downloadDevelSource", VERSION_DEVEL, lang)
 
 print "@c ************************ Manual links ************"
+print ""
+
 for lang in langs:
-    print "@c *********", lang, "***"
-    make_manual_links("Stable", VERSION_STABLE,lang)
-    make_manual_links("Devel", VERSION_DEVEL,lang)
+    print "@c *********", lang or "en", "***"
+    make_manual_links("Stable", VERSION_STABLE, lang)
+    make_manual_links("Devel", VERSION_DEVEL, lang)
 
-    make_doctarball_links("Stable", VERSION_STABLE,lang)
-    make_doctarball_links("Devel", VERSION_DEVEL,lang)
+    make_doctarball_links("Stable", VERSION_STABLE, lang)
+    make_doctarball_links("Devel", VERSION_DEVEL, lang)
 
 print "@c ************************ Regtest links ************"
-for lang in langs:
-    print "@c *********", lang, "***"
-    make_regtest_links("Stable", VERSION_STABLE,lang)
-    make_regtest_links("Devel", VERSION_DEVEL,lang)
-
+print ""
 
+for lang in langs:
+    print "@c *********", lang or "en", "***"
+    make_regtest_links("Stable", VERSION_STABLE, lang)
+    make_regtest_links("Devel", VERSION_DEVEL, lang)
+print "@c ***************************************************"
index 329b412a47f921c0bbeac011d40f56393cb14fa6..ad0f7a6aa90883909cb34b58cbe7271cd7a7a59e 100644 (file)
@@ -53,6 +53,11 @@ author = "Han-Wen Nienhuys and Jan Nieuwenhuizen"
 input_filename = ""
 glob_input = ""
 template = '''\input texinfo
+
+@c This file was autogenerated
+@c     from: %s
+@c     by:   %s
+
 @setfilename %%(name)s.info
 @settitle %%(title)s
 
@@ -83,7 +88,7 @@ template = '''\input texinfo
 %s
 
 @bye
-''' % include_snippets
+''' % (", ".join(files), sys.argv[0], include_snippets)
 
 for opt in options:
     o = opt[0]
@@ -177,4 +182,4 @@ if files:
 else:
     # not Unix philosophy, but hey, at least we notice when
     # we don't distribute any .ly files.
-    sys.stderr.write ("No files specified. Doing nothing")
+    sys.stderr.write ("No files specified. Doing nothing. Use -h to display usage.")
index 734b366f6b7ed91a0232ac36dae090ab7b7675b5..569c892a8f63e7754c6b568c81275df7ef6e4e73 100755 (executable)
@@ -988,9 +988,12 @@ class ComparisonData:
 
         summary += '<p>%d unchanged</p>' % len (unchanged)
 
+        me = sys.argv[0]
+
         html = '''<html>
 <head>
 <title>LilyPond regression test results</title>
+<meta name="author" content="This file was autogenerated by %(me)s">
 <script language="javascript" type="text/javascript">
 // <![CDATA[
     var rows = document.getElementsByTagName("tr");
index 312795e3a1c9cd3251c532c864972ae7e2e0f0d8..ee76feac41b74e7a5ca192d400bb3ae30bb0aeb7 100644 (file)
@@ -1,7 +1,7 @@
 #!@PYTHON@
 #-*- coding: utf-8 -*-
 
-##### This is web_post.py. This script deals with translations
+##### This is website_post.py. This script deals with translations
 ##### in the "make website" target.
 
 import sys
@@ -75,6 +75,7 @@ exclude_manuals = [
 
 ###### Actual program
 
+me = sys.argv[0]
 dir = sys.argv[1]
 
 os.chdir(dir)
@@ -112,6 +113,7 @@ def addLangExt(filename, lang, ext):
 
 def makeFooter (filename, currentLang):
     footer = '''<p id="languages">
+<!-- These links were autogenerated by %(me)s -->
 %(other)s: %(lst)s.
 <br>
 %(browser_language)s
index c62e02145a10001ce095d73b851be94d7f5e6a7d..a421369a723f7022ccecde4c234dabeff65fcfcf 100644 (file)
@@ -26,7 +26,14 @@ target_pattern = os.path.join (outdir, '%s-root')
 static_files = {
     os.path.join (outdir, 'index.html'):
         '''<META HTTP-EQUIV="refresh" content="0;URL=Documentation/web/index.html">
-<html><body>Redirecting to the documentation index...</body></html>\n''',
+<html>
+<head>
+<title>Redirecting...</title>
+<meta name="author" content="This file was autogenerated by %s">
+</head>
+<body>Redirecting to the documentation index...</body>
+</html>
+''' % sys.argv[0],
     os.path.join (outdir, 'VERSION'):
         package_version + '\n',
     }