diff mbox series

[meta-oe] lastlog2: use update-alternatives to solve conflicts with util-linux

Message ID 1724833587-2225-1-git-send-email-wangmy@fujitsu.com
State New
Headers show
Series [meta-oe] lastlog2: use update-alternatives to solve conflicts with util-linux | expand

Commit Message

Mingyu Wang (Fujitsu) Aug. 28, 2024, 8:26 a.m. UTC
From: Wang Mingyu <wangmy@fujitsu.com>

Error: Transaction test error:
  file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
  file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

util-linux also uses the file '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'.
util-linux has a priority of 80.

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
---
 meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Yi Zhao Aug. 28, 2024, 9:39 a.m. UTC | #1
Hi,

I think we can drop this recipe as it has been merged into util-linux 
2.40. As the maintainer said: 
https://github.com/thkukuk/lastlog2/blob/main/README.md


//Yi


On 8/28/24 16:26, wangmy via lists.openembedded.org wrote:
> Error: Transaction test error:
>    file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
>    file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
>
> util-linux also uses the file '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'.
> util-linux has a priority of 80.
>
> Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
> ---
>   meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb b/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
> index ebabcfd40..fb7d877e2 100644
> --- a/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
> +++ b/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
> @@ -22,6 +22,15 @@ SYSTEMD_SERVICE:${PN} = "lastlog2-import.service"
>   
>   EXTRA_OEMESON = " -Dpamlibdir=${base_libdir}/security"
>   
> +inherit update-alternatives
> +
> +ALTERNATIVE:${PN} += "lastlog2 pam_lastlog2"
> +ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
> +ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
> +ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
> +
> +ALTERNATIVE_PRIORITY = "100"
> +
>   do_install:append () {
>         if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
>             # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#112025): https://lists.openembedded.org/g/openembedded-devel/message/112025
> Mute This Topic: https://lists.openembedded.org/mt/108138518/7283133
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [yi.zhao@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb b/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
index ebabcfd40..fb7d877e2 100644
--- a/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
+++ b/meta-oe/recipes-extended/lastlog2/lastlog2_1.3.1.bb
@@ -22,6 +22,15 @@  SYSTEMD_SERVICE:${PN} = "lastlog2-import.service"
 
 EXTRA_OEMESON = " -Dpamlibdir=${base_libdir}/security"
 
+inherit update-alternatives
+ 
+ALTERNATIVE:${PN} += "lastlog2 pam_lastlog2"
+ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
+ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ 
+ALTERNATIVE_PRIORITY = "100"
+
 do_install:append () {
       if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
           # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)