This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: wwwdocs: Broken links due to the preprocess script

Hi Tobias,

On Fri, 25 Oct 2013, Tobias Burnus wrote:
>> However, some script changes the link to:
>> which won't work. Try yourself at
>> Actually, a similar issue was reported at
> The reason for the broken links are the following lines in the
> /www/bin/preprocess script:
> Gerald, do you still know why you added it 9 years ago? The commit 
> comment is "Use sed to work around makeinfo 4.7 brokenness."

yes, I do recall.

This was to work around a less then well advised change in makeinfo 
that replaced "-" in the local part of URLs by encoding it as "_002d".  
I firmly believe that this approach creates ugly and harder to use URLs 
for what I consider theoretical benefits only.

Cf. #alpha_002a_002d_002a_002d_002a vs  #alpha*-*-*, for a real example.

Here are some historical references

> I think "makeinfo" is still broken, but those pages do not seem to go 
> through the preprocess script, which means that only links to that page 
> will change to a hyphen, breaking the links.
> Do you think it would be sensible to remove those lines again - or,
> alternatively, to run a similar script (e.g. "perl -i -e 's/_002d/-/g' `find
> onlinedocs -name \*.html`) on the onlinedocs/.

>From all I can tell, we should do the latter, that is, ensure that our
other web pages (/onlinedocs) are adjusted properly as well.

And maintainer-scripts/update_web_docs_svn was supposed to do that,
alas I just realize it is only handling wwwdocs/htdocs, not what we
generate for /onlinedocs.

Below you'll find a patch for maintainer-scripts/update_web_docs_svn
which I tested on and the current documentation pages (not 
those for older releases) are adjusted now.  

Among others this fixes the link you reported above (though adjusting
gcc-4.9/changes.html directly is now a logical next step).



2013-12-02  Gerald Pfeifer  <> 
        * update_web_docs_svn: Work around makeinfo generated file names 
        and references with "_002d" instead of "-". 

Index: maintainer-scripts/update_web_docs_svn
--- update_web_docs_svn	(revision 205584)
+++ update_web_docs_svn	(working copy)
@@ -172,6 +172,19 @@
+# Work around makeinfo generated file names and references with
+# "_002d" instead of "-".
+find . -name '*.html' | while read f; do
+  # Do this for the contents of each file.
+  sed -i -e 's/_002d/-/g' "$f"
+  # And rename files if necessary.
+  ff=`echo $f | sed -e 's/_002d/-/g'`;
+  if [ "$f" != "$ff" ]; then
+    printf "Renaming %s to %s\n" "$f" "$ff" 
+    mv "$f" "$ff"
+  fi
 # Then build a gzipped copy of each of the resulting .html, .ps and .tar files
 for file in */*.html *.ps *.pdf *.tar; do
   cat $file | gzip --best > $file.gz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]