This is the mail archive of the
mailing list for the GCC project.
Re: wwwdocs: Broken links due to the preprocess script
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: gcc-patches at gcc dot gnu dot org, Tobias Burnus <burnus at net-b dot de>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Date: Mon, 2 Dec 2013 12:02:51 +0100 (CET)
- Subject: Re: wwwdocs: Broken links due to the preprocess script
- Authentication-results: sourceware.org; auth=none
- References: <526978A3 dot 30708 at net-b dot de> <alpine dot LNX dot 2 dot 00 dot 1310250003290 dot 1804 at trevally dot site> <526A0AF3 dot 1030607 at net-b dot de> <526AD55F dot 7050703 at net-b dot de>
On Fri, 25 Oct 2013, Tobias Burnus wrote:
>> However, some script changes the link to:
>> which won't work. Try yourself at http://gcc.gnu.org/gcc-4.9/changes.html
>> 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 gcc.gnu.org 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 <email@example.com>
* update_web_docs_svn: Work around makeinfo generated file names
and references with "_002d" instead of "-".
--- 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"
# 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