Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: <mingli.yu@windriver.com>
To: <openembedded-devel@lists.openembedded.org>, <raj.khem@gmail.com>
Subject: [meta-networking][PATCH v2] postfix: fix pkg_postinst_${PN}
Date: Thu, 13 Sep 2018 17:34:52 +0800	[thread overview]
Message-ID: <20180913093452.357414-1-mingli.yu@windriver.com> (raw)
In-Reply-To: <fbed68fd-3ec8-6058-e43b-329232c1e960@windriver.com>

From: Mingli Yu <Mingli.Yu@windriver.com>

"exit 0" will break the postinst logic
below the line "exit 0" such as:
===
update-alternatives --install /usr/sbin/sendmail sendmail /usr/sbin/sendmail.postfix 120
update-alternatives --install /usr/bin/mailq mailq /usr/bin/mailq.postfix 120
update-alternatives --install /usr/bin/newaliases newaliases /usr/bin/newaliases.postfix 120
===

It's enough to call "$INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}"
, so remove it to guarantee the postinstall logic is correct

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
 meta-networking/recipes-daemons/postfix/postfix.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
index 49f9f7b1f..882b27b6e 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -246,10 +246,10 @@ pkg_postinst_${PN} () {
         # This can fail depending on host setup
         if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
             $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
-            exit 0
+        else
+            touch $D/etc/postfix/virtual_alias
+            postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
         fi
-        touch $D/etc/postfix/virtual_alias
-        postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
 
     fi
 }
-- 
2.13.3



  parent reply	other threads:[~2018-09-13  9:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13  8:23 [meta-networking][PATCH] postfix: fix pkg_postinst_${PN} mingli.yu
2018-09-13  8:32 ` ChenQi
2018-09-13  9:30   ` Yu, Mingli
2018-09-13  9:34   ` mingli.yu [this message]
2018-09-13 11:07     ` [meta-networking][PATCH v2] " Alexander Kanavin
2018-09-13 11:09       ` Alexander Kanavin
2018-09-14  1:14         ` Yu, Mingli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913093452.357414-1-mingli.yu@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox