[gtk-doc] gtkdoc-mk{html,pdf,man}: evaluate some shell variables
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] gtkdoc-mk{html,pdf,man}: evaluate some shell variables
- Date: Fri, 24 Mar 2017 15:09:53 +0000 (UTC)
commit f42e26efe43ca0af7df339d0c564d9fbdd8b892a
Author: Víctor Manuel Jáquez Leal <vjaquez igalia com>
Date: Fri Mar 24 12:27:07 2017 +0100
gtkdoc-mk{html,pdf,man}: evaluate some shell variables
@datarootdir@ and @datadir@ are strings composed by unevealuated
shell variables. In python we have to evaluate those shell
variables.
This patch tries to do those evaluation to obtain the expected paths.
https://bugzilla.gnome.org/show_bug.cgi?id=780497
gtkdoc-mkhtml.in | 8 ++++----
gtkdoc-mkman.in | 7 ++++---
gtkdoc-mkpdf.in | 7 ++++---
3 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in
index 2a4c420..fc887f1 100644
--- a/gtkdoc-mkhtml.in
+++ b/gtkdoc-mkhtml.in
@@ -41,7 +41,6 @@ remaining_args = options.args[2:]
if options.uninstalled:
# this does not work from buiddir!=srcdir
gtkdocdir = os.path.split(sys.argv[0])[0]
- # traditional Bourne shells may not support -e here, use -f
if not os.path.exists(gtkdocdir + '/gtk-doc.xsl'):
# try to src dir (set from makefiles) too
if os.path.exists(os.path.environ.get("ABS_TOP_SRCDIR", '') + '/gtk-doc.xsl'):
@@ -49,10 +48,11 @@ if options.uninstalled:
styledir=gtkdocdir + '/style'
#echo "uninstalled, gtkdocdir=$gtkdocdir, cwd=$PWD"
else:
- # the first two are needed to resolve datadir
+ # the first vars are needed to resolve datadir
prefix='@prefix@'
- datarootdir='@datarootdir@'
- gtkdocdir='@datadir@/gtk-doc/data'
+ datarootdir="@datarootdir@".replace('${prefix}', prefix)
+ datadir="@datadir@".replace('${datarootdir}', datarootdir)
+ gtkdocdir=os.path.join(datadir, 'gtk-doc/data')
styledir=gtkdocdir
# We need to use a wrapper because there's no other way to conditionally pass
diff --git a/gtkdoc-mkman.in b/gtkdoc-mkman.in
index 0f190b5..ebb9c3a 100644
--- a/gtkdoc-mkman.in
+++ b/gtkdoc-mkman.in
@@ -39,10 +39,11 @@ if options.uninstalled:
gtkdocdir=os.path.split(sys.argv[0])[0]
#echo "uninstalled, gtkdocdir=$gtkdocdir"
else:
- # the first two are needed to resolve datadir
+ # the first vars are needed to resolve datadir
prefix='@prefix@'
- datarootdir='@datarootdir@'
- gtkdocdir='@datadir@/gtk-doc/data'
+ datarootdir="@datarootdir@".replace('${prefix}', prefix)
+ datadir="@datadir@".replace('${datarootdir}', datarootdir)
+ gtkdocdir=os.path.join(datadir, 'gtk-doc/data')
# we could do "$path_option $PWD "
# to avoid needing rewriting entities that are copied from the header
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
index 58b2ab0..8041551 100755
--- a/gtkdoc-mkpdf.in
+++ b/gtkdoc-mkpdf.in
@@ -49,10 +49,11 @@ if options.uninstalled:
gtkdocdir=os.path.split(sys.argv[0])[0]
logging.debug("uninstalled, gtkdocdir=" + gtkdocdir)
else:
- # the first two are needed to resolve datadir
+ # the first vars are needed to resolve datadir
prefix='@prefix@'
- datarootdir='@datarootdir@'
- gtkdocdir='@datadir@'/gtk-doc/data
+ datarootdir="@datarootdir@".replace('${prefix}', prefix)
+ datadir="@datadir@".replace('${datarootdir}', datarootdir)
+ gtkdocdir=os.path.join(datadir, 'gtk-doc/data')
# We need to use a wrapper because there's no other way to conditionally pass
# a `--path $searchpath` argument with proper quoting for the path
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]