diff mbox

generate_libstdcxx_web_docs: Use realpath to get absolute path

Message ID alpine.LSU.2.20.1606121249400.4959@anthias.pfeifer.com
State New
Headers show

Commit Message

Gerald Pfeifer June 12, 2016, 10:53 a.m. UTC
Hi Jonathan,

On Thu, 28 Apr 2016, Jonathan Wakely wrote:
> When I ran maintainer-scripts/generate_libstdcxx_web_docs to make the
> onlinedocs/libstdc++ for 6.1 the other day it failed because I use a
> relative path for the output dir argument. This would make it work,
> but is relying on GNU realpath OK?

realpath also exists on other systems, though the options you used 
are not portable.

How about going with your patch, just without the -es options?  (I 
verified that this works on FreeBSD, for example.)

> I could instead use a Bashism like:
> 
> DOCSDIR=$(test "${2:0:1}" = "/" && echo "$2" || echo "$PWD/$2")

That gives me major headache. :-)

> If it's OK for trunk it could go on the banches too, for generating
> the 4.9.4, 5.4 and 6.2 docs.

Let's go with your patch for trunk and the GCC 6 branch.  Beyond
those, I would not care, though if you feel about it a bit more
strongly, no objection.

Note, there is a second hunk in the patch you posted (cf. the
attached) that makes sense, but will need to be added to the
ChangeLog.

Gerald
diff mbox

Patch

commit b46ffd26927df284ea3c4760a40ce716e8e25fa2
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Apr 27 14:52:03 2016 +0100

    	* generate_libstdcxx_web_docs: Use realpath to get absolute path.

diff --git a/maintainer-scripts/generate_libstdcxx_web_docs b/maintainer-scripts/generate_libstdcxx_web_docs
index 700e522..5878dfe 100755
--- a/maintainer-scripts/generate_libstdcxx_web_docs
+++ b/maintainer-scripts/generate_libstdcxx_web_docs
@@ -3,7 +3,7 @@ 
 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
 
 SRCDIR=${1}
-DOCSDIR=${2}
+DOCSDIR=$(realpath -es ${2})
 
 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
 then
@@ -34,6 +34,9 @@  set -x
 ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
 eval `grep '^target=' config.log`
 make configure-target
+# If the following step fails with an error like
+# ! LaTeX Error: File `xtab.sty' not found.
+# then you need to install the relevant TeX package e.g. texlive-xtab
 make -C $target/libstdc++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR=$DESTDIR
 cd $DESTDIR/docs
 mkdir libstdc++