Skip to contentSkip to conversation

postfix: fix postinstall to avoid do_rootfs failure

PATCH In review Chen Qi 1 participant 2 messages Jul 15, 2019

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 postfix: 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-networking/recipes-daemons/postfix/postfix.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/recipes-daemons/postfix/postfix.inc +1 -1
index 3d4f1df..021129c 100644
@@ -221,7 +221,7 @@ pkg_postinst_${PN} () {
     else
         if ${@'true' if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) else 'false'}; then
             # /usr/lib/sendmail 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
         fi
 
         touch $D/etc/aliases
Signature · 1 line
2.7.4
author
#1 lore raw

Please ignore this patch.
I'll send out a new solution.

Regards,
Chen Qi

Quoted 24 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.

---
  meta-networking/recipes-daemons/postfix/postfix.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/recipes-daemons/postfix/postfix.inc +1 -1
index 3d4f1df..021129c 100644
@@ -221,7 +221,7 @@ pkg_postinst_${PN} () {
      else
          if ${@'true' if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) else 'false'}; then
              # /usr/lib/sendmail 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
          fi
 
          touch $D/etc/aliases