public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path
@ 2016-04-28 12:53 Jonathan Wakely
  2016-06-12 10:53 ` Gerald Pfeifer
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2016-04-28 12:53 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

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?

I think in practice nobody is going to generate those docs on anything
other than GNU/Linux, but I could instead use a Bashism like:

DOCSDIR=$(test "${2:0:1}" = "/" && echo "$2" || echo "$PWD/$2")

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.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1128 bytes --]

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++

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path
  2016-04-28 12:53 [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path Jonathan Wakely
@ 2016-06-12 10:53 ` Gerald Pfeifer
  2016-06-13  7:58   ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Gerald Pfeifer @ 2016-06-12 10:53 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

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

[-- Attachment #2: Type: text/x-patch, Size: 1128 bytes --]

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++

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path
  2016-06-12 10:53 ` Gerald Pfeifer
@ 2016-06-13  7:58   ` Jonathan Wakely
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2016-06-13  7:58 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

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.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1166 bytes --]

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++

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-13  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28 12:53 [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path Jonathan Wakely
2016-06-12 10:53 ` Gerald Pfeifer
2016-06-13  7:58   ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).