diff mbox series

[v2] tools/build-docs-container: use CONTAINERCMD to append args

Message ID 20251013-fix-build-docs-container-args-v2-1-9ac0fd56bc65@bootlin.com
State Under Review
Headers show
Series [v2] tools/build-docs-container: use CONTAINERCMD to append args | expand

Commit Message

Antonin Godard Oct. 13, 2025, 7:12 a.m. UTC
What we have is OCI = $(which $CONTAINERCMD) = /usr/bin/{docker,podman}.
So we never pass the current if conditions. Compare against the basename
of OCI to pass the checks.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Changes in v2:
- Use basename on OCI instead of CONTAINERCMD, in case we use
  docker-podman (thanks Quentin for pointing that out).
- Link to v1: https://lore.kernel.org/r/20251009-fix-build-docs-container-args-v1-1-169ce4248462@bootlin.com
---
 documentation/tools/build-docs-container | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: 09c7800333b17b21e50d2a089a3ae1b123697243
change-id: 20251009-fix-build-docs-container-args-d50c9ecbf7bf

Best regards,
--  
Antonin Godard <antonin.godard@bootlin.com>

Comments

Quentin Schulz Oct. 13, 2025, 9:56 a.m. UTC | #1
Hi Antonin,

On 10/13/25 9:12 AM, Antonin Godard via lists.yoctoproject.org wrote:
> What we have is OCI = $(which $CONTAINERCMD) = /usr/bin/{docker,podman}.
> So we never pass the current if conditions. Compare against the basename
> of OCI to pass the checks.
> 
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin
diff mbox series

Patch

diff --git a/documentation/tools/build-docs-container b/documentation/tools/build-docs-container
index 70e05f295..791b36c3a 100755
--- a/documentation/tools/build-docs-container
+++ b/documentation/tools/build-docs-container
@@ -157,11 +157,11 @@  main ()
     --security-opt label=disable
   )
 
-  if [ "$OCI" = "docker" ]; then
+  if [ "$(basename "$OCI")" = "docker" ]; then
     args_run+=(
       --user="$(id -u)":"$(id -g)"
     )
-  elif [ "$OCI" = "podman" ]; then
+  elif [ "$(basename "$OCI")" = "podman" ]; then
     # we need net access to fetch bitbake terms
     args_run+=(
       --cap-add=NET_RAW