Skip to contentSkip to conversation

postfix: adapt pkg_postinst to postinst_intercept

PATCH New Joe Slater 1 participant 1 message Feb 8, 2018

lore
Share & tools
lore

Joe Slater

author
#0 lore raw

PATCH 1/1 postfix: adapt pkg_postinst to postinst_intercept

Request delay to first boot if newaliases fails on host. Check for linuxstdbase before we might fail.

---
 meta-networking/recipes-daemons/postfix/postfix.inc | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
meta-networking/recipes-daemons/postfix/postfix.inc +10 -5
index fa5eef9..09447d5 100644
@@ -239,15 +239,20 @@ pkg_postinst_${PN} () {
         touch /etc/postfix/virtual_alias
         postmap /etc/postfix/virtual_alias
     else
-        touch $D/etc/aliases
-        newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases
-        touch $D/etc/postfix/virtual_alias
-        postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
-
         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/
         fi
+
+        touch $D/etc/aliases
+        # 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
+        fi
+        touch $D/etc/postfix/virtual_alias
+        postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
+
     fi
 }
 
Signature · 1 line
2.7.4