[PATCH yocto-autobuilder-helper 2/6] scripts: run-docs-build: allow to pass buildtools script and docbook tarball paths

Quentin Schulz

From: Quentin Schulz <quentin.schulz@...>

Currently, the path to buildtools script and docbook tarball are
hardcoded to work on Yocto Project Autobuilder. However, this makes it
harder to contribute to this script because it is very unlikely those
paths exist on a developer PC.

Instead, let's allow to override variables by using the environment and
make the current hardcoded values the default ones.

Cc: Quentin Schulz <foss+yocto@...>
Signed-off-by: Quentin Schulz <quentin.schulz@...>
scripts/run-docs-build | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 6e25549..6569928 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -2,6 +2,12 @@
# Called with $1 as the build directory
# $2 as the path to yocto-docs
# $3 as the path to bitbake
+# Environment variables:
+# - docs_buildtools as the path to buildtools script for the docs.
+# Can be found here: https://autobuilder.yocto.io/pub/buildtools/
+# - docbookarchive as the path to old (pre 3.1.5 and Sphinx migration) docs tarball
+# Can be found here: https://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-archives-20201105.tar.xz

set -e
set -u
@@ -11,7 +17,7 @@ set -x
builddir=$(realpath "$1")
ypdocs=$(realpath "$2/documentation/")
bbdocs=$(realpath "$3/doc/")
scriptdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"

@@ -23,7 +29,7 @@ $docs_buildtools -y -d $builddir/buildtools

# Getting the old docbook built docs from an archive. Not rebuilding them.
#wget https://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-archives-20201105.tar.xz
mkdir $outputdir
cd $outputdir
echo Extracing old content from archive