[libvirt PATCH v2 0/2] ci: Fix paths shown in the website

Compare https://abologna.gitlab.io/-/libvirt/-/jobs/2840280594/artifacts/website/man... with https://libvirt.org/manpages/virtqemud.html#files Changes from [v1]: * don't use pathlib; * don't check whether DESTDIR is absolute. [v1] https://listman.redhat.com/archives/libvir-list/2022-July/232929.html Andrea Bolognani (2): scripts: Add $DESTDIR support to meson-install-web.py ci: Fix paths shown in the website .gitlab-ci.yml | 6 +++--- scripts/meson-install-web.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) -- 2.37.1

meson already supports $DESTDIR natively, but in this case we're using a custom script and so we have to do some extra work ourselves. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- scripts/meson-install-web.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py index a03f8523cd..086d465ae4 100755 --- a/scripts/meson-install-web.py +++ b/scripts/meson-install-web.py @@ -4,7 +4,11 @@ import os import shutil import sys +destdir = os.environ.get('DESTDIR', os.sep) + for desc in sys.argv[1:]: inst = desc.split(':') - os.makedirs(inst[1], exist_ok=True) - shutil.copy(inst[0], inst[1]) + src = inst[0] + dst = os.path.join(destdir, inst[1].strip(os.sep)) + os.makedirs(dst, exist_ok=True) + shutil.copy(src, dst) -- 2.37.1

Right now we're setting the prefix to a custom path, which results in paths like /builds/libvirt/libvirt/vroot/etc/libvirt/virtqemud.conf ending up in the generated HTML. In order to avoid that, set the prefix and other installation paths to reasonable default values by passing -Dsystem=true and then take advantage of $DESTDIR support to still be able to write the HTML files without requiring root privileges. Reported-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39c5f8fb6d..f6ed14bf65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,9 +67,9 @@ website: before_script: - *script_variables script: - - meson setup build --werror --prefix=$(pwd)/vroot || (cat build/meson-logs/meson-log.txt && exit 1) - - ninja -C build install-web - - mv vroot/share/doc/libvirt/html/ website + - meson setup build --werror -Dsystem=true || (cat build/meson-logs/meson-log.txt && exit 1) + - DESTDIR=$(pwd)/install ninja -C build install-web + - mv install/usr/share/doc/libvirt/html/ website artifacts: expose_as: 'Website' name: 'website' -- 2.37.1

On Wed, Aug 10, 2022 at 06:17:11PM +0200, Andrea Bolognani wrote:
Compare
https://abologna.gitlab.io/-/libvirt/-/jobs/2840280594/artifacts/website/man...
with
https://libvirt.org/manpages/virtqemud.html#files
Changes from [v1]:
* don't use pathlib; * don't check whether DESTDIR is absolute.
[v1] https://listman.redhat.com/archives/libvir-list/2022-July/232929.html
Andrea Bolognani (2): scripts: Add $DESTDIR support to meson-install-web.py ci: Fix paths shown in the website
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina