From 1462472be5bd9cff30c9237d360f6691997b6cee Mon Sep 17 00:00:00 2001 From: rkopicki <174372448+rkopicki@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:26:02 +0200 Subject: [PATCH 1/2] Enable use of a symlink to bin/docbook (.py) Correct docbook (.py) sample installation path. Resolve a possible symbolic link to bin/docbook before returning its absolute path. --- src/bin/docbook.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/docbook.py b/src/bin/docbook.py index c352c08335..3bba176239 100755 --- a/src/bin/docbook.py +++ b/src/bin/docbook.py @@ -64,10 +64,12 @@ def __init__(self, args): self._cp = {} self._seen = {} - # This script assumes it's in /path/to/somewhere/docbook/bin/python + # This script assumes it's in /path/to/somewhere/docbook/bin # where "docbook" is the root of the distribution. If you move # this script into /usr/local/bin or something, it won't work. - self.root = os.path.abspath(__file__) + # Instead, create a symbolic link with: + # ln -s /path/to/somewhere/docbook/bin/docbook /usr/local/bin/docbook + self.root = os.path.realpath(__file__) self.root = self.root[0:self.root.rfind(os.sep)] # strip /docbook self.root = self.root[0:self.root.rfind(os.sep)] # strip /bin From 053c89bb7a559d1385a95a63a8c2aa30ff12e9cc Mon Sep 17 00:00:00 2001 From: rkopicki <174372448+rkopicki@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:15:08 +0200 Subject: [PATCH 2/2] Fix bin/docbook exit code 0 even though Java rises an exception Sample, otherwise valid, DocBook 5 file `https://docbook.org/docs/howto/howto.xml` cannot be processed due to XPTY0004 caused by multiple `` entries, but bin/docbook exits with 0 (no error) creating an empty output file. --- src/bin/docbook.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/docbook.py b/src/bin/docbook.py index 3bba176239..7c91cfe357 100755 --- a/src/bin/docbook.py +++ b/src/bin/docbook.py @@ -15,6 +15,7 @@ class JavaClassRunnerException(Exception): """Subclass of Exception for errors raised by the runner.""" + pass class JavaClassRunner: