Skip to contentSkip to conversation

msmtp: fix postinstall to avoid do_rootfs failure

PATCH In review Chen Qi 2 participants 6 messages Jul 15, 2019

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover msmtp: fix postinstall to avoid do_rootfs failure

*** BLURB HERE ***
The following changes since commit 80ab79168ede2786868cbd354f0950c949f73527:

gnome-themes-standard: remove (2019-07-11 09:32:50 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/msmtp-lsb
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/msmtp-lsb

Chen Qi (1):
msmtp: fix postinstall to avoid do_rootfs failure

 meta/recipes-extended/msmtp/msmtp_1.8.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 msmtp: fix postinstall to avoid do_rootfs failure

When lsb is enabled, that is, 'linuxstdbase' is in OVERRIDES, do_rootfs would fail if both 'msmtp' and 'postfix' are installed. This is because they both try to create /usr/lib/sendmail link if it does not exist. So we need to fix the check to avoid non-zero exit status.

---
 meta/recipes-extended/msmtp/msmtp_1.8.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/msmtp/msmtp_1.8.4.bb +1 -1
index 888c1bb..bd8552c 100644
@@ -25,5 +25,5 @@ ALTERNATIVE_PRIORITY = "100"
 
 pkg_postinst_${PN}_linuxstdbase () {
 	# /usr/lib/sendmial is required by LSB core test
-	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/ || true
 }
Signature · 1 line
1.9.1
#2 lore raw
Quoted 6 lines · Chen Qi

When lsb is enabled, that is, 'linuxstdbase' is in OVERRIDES, do_rootfs would fail if both 'msmtp' and 'postfix' are installed. This is because they both try to create /usr/lib/sendmail link if it does not exist. So we need to fix the check to avoid non-zero exit status.
...

This would make it random (depending on installation order) which is linked to, and it could also make ${sbindir}/sendmail and $D/usr/lib/sendmail point to different programs.

It would be better to make $D/usr/lib/sendmail also an alternative in all packages that provide sendmail.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#3 lore raw
Quoted 11 lines · Adrian Bunk
Quoted 6 lines · Chen Qi

When lsb is enabled, that is, 'linuxstdbase' is in OVERRIDES, do_rootfs would fail if both 'msmtp' and 'postfix' are installed. This is because they both try to create /usr/lib/sendmail link if it does not exist. So we need to fix the check to avoid non-zero exit status.
...

This would make it random (depending on installation order) which is linked to, and it could also make ${sbindir}/sendmail and $D/usr/lib/sendmail point to different programs.

Quoted 6 lines

It would be better to make $D/usr/lib/sendmail also an alternative in all packages that provide sendmail.

cu
Adrian

I don't think we should mix linuxstdbase and ALTERNATIVES setting. It makes things complicated. As ALTERNATIVES_PRIORITY is higher in postfix, I'll just remove the check in postfix and use 'ln -sf' directly. Can you accept this solution?

Regards,
Chen Qi

#4 lore raw
Quoted 15 lines · ChenQi
Quoted 14 lines · Adrian Bunk
Quoted 6 lines · Chen Qi

When lsb is enabled, that is, 'linuxstdbase' is in OVERRIDES, do_rootfs would fail if both 'msmtp' and 'postfix' are installed. This is because they both try to create /usr/lib/sendmail link if it does not exist. So we need to fix the check to avoid non-zero exit status.
...

This would make it random (depending on installation order) which is linked to, and it could also make ${sbindir}/sendmail and $D/usr/lib/sendmail point to different programs.

It would be better to make $D/usr/lib/sendmail also an alternative in all packages that provide sendmail.

Quoted 8 lines
Quoted 3 lines

cu
Adrian

I don't think we should mix linuxstdbase and ALTERNATIVES setting. It makes things complicated.
As ALTERNATIVES_PRIORITY is higher in postfix, I'll just remove the check in postfix and use 'ln -sf' directly.
Can you accept this solution?

I do not see how this solves your problem if msmtp gets installed after postfix.

Is it actually required to have these packages installed at the same time in LSB?

If not, something like
RCONFLICTS_linuxstdbase = "postfix"
might work. (untested)

Quoted 2 lines

Regards,
Chen Qi

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#5 lore raw
Quoted 30 lines · Adrian Bunk
Quoted 15 lines · ChenQi
Quoted 14 lines · Adrian Bunk
Quoted 6 lines · Chen Qi

When lsb is enabled, that is, 'linuxstdbase' is in OVERRIDES, do_rootfs would fail if both 'msmtp' and 'postfix' are installed. This is because they both try to create /usr/lib/sendmail link if it does not exist. So we need to fix the check to avoid non-zero exit status.
...

This would make it random (depending on installation order) which is linked to, and it could also make ${sbindir}/sendmail and $D/usr/lib/sendmail point to different programs.

It would be better to make $D/usr/lib/sendmail also an alternative in all packages that provide sendmail.

Quoted 8 lines
Quoted 3 lines

cu
Adrian

I don't think we should mix linuxstdbase and ALTERNATIVES setting. It makes things complicated.
As ALTERNATIVES_PRIORITY is higher in postfix, I'll just remove the check in postfix and use 'ln -sf' directly.
Can you accept this solution?

I do not see how this solves your problem if msmtp gets installed after postfix.

Is it actually required to have these packages installed at the same time in LSB?

Quoted 9 lines

If not, something like
RCONFLICTS_linuxstdbase = "postfix"
might work. (untested)

Quoted 2 lines

Regards,
Chen Qi

cu
Adrian

Hi Adrian,

I've sent out V2 using alternatives.

Best Regards,

Chen Qi