From: Ming Liu <[email protected]>

Add alternative link for docker when 'docker' pkgconfig is enabled,
this allows it could be installed together with docker-cli package.

Signed-off-by: Ming Liu <[email protected]>
---
 recipes-containers/podman/podman_git.bb | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/recipes-containers/podman/podman_git.bb 
b/recipes-containers/podman/podman_git.bb
index 7634ac85..e021dcd4 100644
--- a/recipes-containers/podman/podman_git.bb
+++ b/recipes-containers/podman/podman_git.bb
@@ -63,11 +63,16 @@ EXTRA_OEMAKE = " \
      SYSTEMDDIR=${systemd_unitdir}/system 
USERSYSTEMDDIR=${systemd_unitdir}/user \
 "
 
-# remove 'docker' from the packageconfig if you don't want podman to
-# build and install the docker wrapper. If docker is enabled in the
-# packageconfig, the podman package will rconfict with docker.
 PACKAGECONFIG ?= "docker"
 
+UPDATE_ALTERNATIVES_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'docker', 
'update-alternatives', '', d)}"
+
+inherit ${UPDATE_ALTERNATIVES_BBCLASS}
+
+ALTERNATIVE_PRIORITY = "50"
+ALTERNATIVE:${PN} = "docker"
+ALTERNATIVE_LINK_NAME[docker] = "${bindir}/docker"
+
 do_compile() {
        cd ${S}/src
        rm -rf .gopath
@@ -151,7 +156,6 @@ RDEPENDS:${PN} += "\
        ${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'fuse-overlayfs 
slirp4netns', '', d)} \
 "
 RRECOMMENDS:${PN} += "slirp4netns kernel-module-xt-masquerade 
kernel-module-xt-comment"
-RCONFLICTS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'docker', 'docker', 
'', d)}"
 
 RDEPENDS:${PN}-ptest += " \
        bash \
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8497): 
https://lists.yoctoproject.org/g/meta-virtualization/message/8497
Mute This Topic: https://lists.yoctoproject.org/mt/103107328/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to