[PATCH] Embed qmtest version in urls to internals manual

Nathaniel Smith njs at pobox.com
Mon May 24 15:30:06 UTC 2004


Currently, the manual distributed with QMTest contains URL references
to the internals manual at codesourcery.com.  These links don't
contain any version information, which means that there's no way to
update the web site without changing the content referred to by old
manuals.

Ideally, we would ship the internals manual with QMTest, but this 1)
adds a build dependency on happydoc, and 2) is a somewhat complicated
change.  In the mean time, the attached patch causes these links in
the manual to go to the internals manual for the proper version.

Attached for review.

-- Nathaniel

-- 
So let us espouse a less contested notion of truth and falsehood, even
if it is philosophically debatable (if we listen to philosophers, we
must debate everything, and there would be no end to the discussion).
  -- Serendipities, Umberto Eco
-------------- next part --------------
? results.qmr
? doc/qm-version
? tests/regress/QMTest/regression_database.pyc
? tests/regress/QMTest/selftest.pyc
? tests/regress/tuple1/QMTest/tuple_test.pyc
? tests/results_files/QMTest/results_file_database.pyc
? tests/results_files/QMTest/results_file_test.pyc
Index: ChangeLog
===================================================================
RCS file: /home/qm/Repository/qm/ChangeLog,v
retrieving revision 1.620
diff -u -r1.620 ChangeLog
--- ChangeLog	22 May 2004 01:53:20 -0000	1.620
+++ ChangeLog	24 May 2004 15:24:59 -0000
@@ -1,3 +1,11 @@
+2004-05-24  Nathaniel Smith  <njs at codesourcery.com>
+
+	* qmdist/command/build_doc.py (build_doc.run): Create
+	'doc/qm-version' file.
+	* doc/qm.mod: Define entity 'qm_version' to its contents.
+	* qm/test/doc/manual.xml (internal_doc_url): Use
+	'qm_version_entity' in definition.
+
 2004-05-21  Nathaniel Smith  <njs at codesourcery.com>
 
 	* qm/test/target.py (Target.Start): Add instance variable
Index: doc/qm.mod
===================================================================
RCS file: /home/qm/Repository/qm/doc/qm.mod,v
retrieving revision 1.13
diff -u -r1.13 qm.mod
--- doc/qm.mod	5 Dec 2001 20:01:47 -0000	1.13
+++ doc/qm.mod	24 May 2004 15:24:59 -0000
@@ -16,6 +16,10 @@
 
 -->
 
+<!-- Version number. -->
+
+<!ENTITY qm_version SYSTEM "qm-version">
+
 <!-- Names of the project components.  -->
 
 <!ENTITY sc "<ulink url="http://www.software-carpentry.com">Software Carpentry</ulink>">
Index: qm/test/doc/manual.xml
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/doc/manual.xml,v
retrieving revision 1.5
diff -u -r1.5 manual.xml
--- qm/test/doc/manual.xml	29 Sep 2003 00:49:30 -0000	1.5
+++ qm/test/doc/manual.xml	24 May 2004 15:24:59 -0000
@@ -32,7 +32,7 @@
   <!ENTITY tour.xml SYSTEM "tour.xml">
   <!ENTITY reference.xml SYSTEM "reference.xml">
 
-  <!ENTITY internal_doc_url "http://www.codesourcery.com/qm/qmtest_internals_docs/qm">
+  <!ENTITY internal_doc_url "http://www.codesourcery.com/public/qmtest/qm-&qm_version;/internals/qm">
 
   <!ENTITY context_class "<ulink url="&internal_doc_url;/test/context/Context.html"><classname>Context</classname></ulink>">
   <!ENTITY result_class "<ulink url="&internal_doc_url;/test/result/Result.html"><classname>Result</classname></ulink>">
Index: qmdist/command/build_doc.py
===================================================================
RCS file: /home/qm/Repository/qm/qmdist/command/build_doc.py,v
retrieving revision 1.3
diff -u -r1.3 build_doc.py
--- qmdist/command/build_doc.py	4 Dec 2003 02:38:09 -0000	1.3
+++ qmdist/command/build_doc.py	24 May 2004 15:24:59 -0000
@@ -127,6 +127,16 @@
         # install the documentation as data files (in "share") rather
         # than as program files (in "lib").
         
+        # 
+        # Write the version to a file so the manual can refer to it.  This
+        # file contains exactly the version number -- there must be no
+        # trailing newline, for example.
+        #
+        self.announce("writing version file")
+        f = open(os.path.join("doc", "qm-version"), "w")
+        f.write(self.distribution.get_version())
+        f.close()
+
         #
         # Build html output.
         #


More information about the qmtest mailing list