diff mbox

generate_libstdcxx_web_docs: Use realpath to get absolute path

Message ID 20160613075754.GW2629@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely June 13, 2016, 7:57 a.m. UTC
On 12/06/16 12:53 +0200, Gerald Pfeifer wrote:
>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

I've committed this to trunk and gcc-6-branch.
diff mbox

Patch

commit c03949980e1177d6d71b9de0f2f8e6e1048e45f1
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.
    
    	Add comment about LaTeX errors.

diff --git a/maintainer-scripts/generate_libstdcxx_web_docs b/maintainer-scripts/generate_libstdcxx_web_docs
index 700e522..00ebcbf 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 ${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++