Commit af922187 authored by Fred Drake's avatar Fred Drake

Job.build_html(): Be more robust in ensuring about.html exists; copying

    the right HTML file to the name about.html is needed even if the
    --numeric option was not given -- some other name may have been
    assigned due to some non-determinism in the algorithm use to perform
    name allocation.  ;-(

This closes the "About..." portion of SF bug #420216.
parent a7c9ac65
...@@ -369,24 +369,23 @@ class Job: ...@@ -369,24 +369,23 @@ class Job:
shutil.copyfile(os.path.join(builddir, self.doc + ".html"), shutil.copyfile(os.path.join(builddir, self.doc + ".html"),
os.path.join(builddir, "index.html")) os.path.join(builddir, "index.html"))
if max_split_depth != 1: if max_split_depth != 1:
if self.options.numeric: label_file = os.path.join(builddir, "labels.pl")
label_file = os.path.join(builddir, "labels.pl") fp = open(label_file)
fp = open(label_file) about_node = None
about_node = None target = " = q/about/;\n"
target = " = q/about/;\n" x = len(target)
x = len(target) while 1:
while 1: line = fp.readline()
if not line:
break
if line[-x:] == target:
line = fp.readline() line = fp.readline()
if not line: m = re.search(r"\|(node\d+\.[a-z]+)\|", line)
break about_node = m.group(1)
if line[-x:] == target: shutil.copyfile(os.path.join(builddir, about_node),
line = fp.readline() os.path.join(builddir, "about.html"))
m = re.search(r"\|(node\d+\.[a-z]+)\|", line) break
about_node = m.group(1) if not self.options.numeric:
shutil.copyfile(os.path.join(builddir, about_node),
os.path.join(builddir, "about.html"))
break
else:
pwd = os.getcwd() pwd = os.getcwd()
try: try:
os.chdir(builddir) os.chdir(builddir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment