* [meta-networking][PATCH] postfix: fix pkg_postinst_${PN}
@ 2018-09-13 8:23 mingli.yu
2018-09-13 8:32 ` ChenQi
0 siblings, 1 reply; 7+ messages in thread
From: mingli.yu @ 2018-09-13 8:23 UTC (permalink / raw)
To: openembedded-devel, raj.khem
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 | 1 -
1 file changed, 1 deletion(-)
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
index 49f9f7b1f..71d7ef5df 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -246,7 +246,6 @@ 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
fi
touch $D/etc/postfix/virtual_alias
postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
--
2.13.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [meta-networking][PATCH] postfix: fix pkg_postinst_${PN}
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 ` [meta-networking][PATCH v2] " mingli.yu
0 siblings, 2 replies; 7+ messages in thread
From: ChenQi @ 2018-09-13 8:32 UTC (permalink / raw)
To: mingli.yu, openembedded-devel, raj.khem
On 09/13/2018 04:23 PM, mingli.yu@windriver.com wrote:
> 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 | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
> index 49f9f7b1f..71d7ef5df 100644
> --- a/meta-networking/recipes-daemons/postfix/postfix.inc
> +++ b/meta-networking/recipes-daemons/postfix/postfix.inc
> @@ -246,7 +246,6 @@ 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
> fi
> touch $D/etc/postfix/virtual_alias
> postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
I guess you need to use the if...else... block here.
Regards,
Chen Qi
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [meta-networking][PATCH] postfix: fix pkg_postinst_${PN}
2018-09-13 8:32 ` ChenQi
@ 2018-09-13 9:30 ` Yu, Mingli
2018-09-13 9:34 ` [meta-networking][PATCH v2] " mingli.yu
1 sibling, 0 replies; 7+ messages in thread
From: Yu, Mingli @ 2018-09-13 9:30 UTC (permalink / raw)
To: ChenQi, openembedded-devel, raj.khem
On 2018年09月13日 16:32, ChenQi wrote:
> On 09/13/2018 04:23 PM, mingli.yu@windriver.com wrote:
>> 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 | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc
>> b/meta-networking/recipes-daemons/postfix/postfix.inc
>> index 49f9f7b1f..71d7ef5df 100644
>> --- a/meta-networking/recipes-daemons/postfix/postfix.inc
>> +++ b/meta-networking/recipes-daemons/postfix/postfix.inc
>> @@ -246,7 +246,6 @@ 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
>> fi
>> touch $D/etc/postfix/virtual_alias
>> postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
> I guess you need to use the if...else... block here.
Thanks Qi, Will send out v2 to update the logic.
Thanks,
>
> Regards,
> Chen Qi
>
^ permalink raw reply [flat|nested] 7+ messages in thread* [meta-networking][PATCH v2] postfix: fix pkg_postinst_${PN}
2018-09-13 8:32 ` ChenQi
2018-09-13 9:30 ` Yu, Mingli
@ 2018-09-13 9:34 ` mingli.yu
2018-09-13 11:07 ` Alexander Kanavin
1 sibling, 1 reply; 7+ messages in thread
From: mingli.yu @ 2018-09-13 9:34 UTC (permalink / raw)
To: openembedded-devel, raj.khem
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [meta-networking][PATCH v2] postfix: fix pkg_postinst_${PN}
2018-09-13 9:34 ` [meta-networking][PATCH v2] " mingli.yu
@ 2018-09-13 11:07 ` Alexander Kanavin
2018-09-13 11:09 ` Alexander Kanavin
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2018-09-13 11:07 UTC (permalink / raw)
To: Yu, Mingli; +Cc: OpenEmbedded Devel List
I might not be understanding this. Why is the original fragment
incorrect and the new one correct?
Original:
# 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
}
Patched:
if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
$INTERCEPT_DIR/postinst_intercept delay_to_first_boot
${PKG} mlprefix=${MLPREFIX}
else
touch $D/etc/postfix/virtual_alias
postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
fi
fi
}
What problem is being fixed here?
Alex
2018-09-13 11:34 GMT+02:00 <mingli.yu@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
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [meta-networking][PATCH v2] postfix: fix pkg_postinst_${PN}
2018-09-13 11:07 ` Alexander Kanavin
@ 2018-09-13 11:09 ` Alexander Kanavin
2018-09-14 1:14 ` Yu, Mingli
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2018-09-13 11:09 UTC (permalink / raw)
To: Yu, Mingli; +Cc: OpenEmbedded Devel List
Ah, now I get it - there might be more lines in the postinst script
added from elsewhere. Correct?
Alex
2018-09-13 13:07 GMT+02:00 Alexander Kanavin <alex.kanavin@gmail.com>:
> I might not be understanding this. Why is the original fragment
> incorrect and the new one correct?
>
> Original:
>
> # 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
> }
>
>
> Patched:
>
> if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
> $INTERCEPT_DIR/postinst_intercept delay_to_first_boot
> ${PKG} mlprefix=${MLPREFIX}
> else
> touch $D/etc/postfix/virtual_alias
> postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
> fi
>
> fi
> }
>
>
>
> What problem is being fixed here?
>
> Alex
>
> 2018-09-13 11:34 GMT+02:00 <mingli.yu@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
>>
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [meta-networking][PATCH v2] postfix: fix pkg_postinst_${PN}
2018-09-13 11:09 ` Alexander Kanavin
@ 2018-09-14 1:14 ` Yu, Mingli
0 siblings, 0 replies; 7+ messages in thread
From: Yu, Mingli @ 2018-09-14 1:14 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OpenEmbedded Devel List
On 2018年09月13日 19:09, Alexander Kanavin wrote:
> Ah, now I get it - there might be more lines in the postinst script
> added from elsewhere. Correct?
Hi Alex,
You are right, there is some other postinst script logic added such as
by update-alternatives.bbclass.
Thanks,
>
>
> Alex
>
> 2018-09-13 13:07 GMT+02:00 Alexander Kanavin <alex.kanavin@gmail.com>:
>> I might not be understanding this. Why is the original fragment
>> incorrect and the new one correct?
>>
>> Original:
>>
>> # 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
>> }
>>
>>
>> Patched:
>>
>> if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
>> $INTERCEPT_DIR/postinst_intercept delay_to_first_boot
>> ${PKG} mlprefix=${MLPREFIX}
>> else
>> touch $D/etc/postfix/virtual_alias
>> postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
>> fi
>>
>> fi
>> }
>>
>>
>>
>> What problem is being fixed here?
>>
>> Alex
>>
>> 2018-09-13 11:34 GMT+02:00 <mingli.yu@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
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-devel mailing list
>>> Openembedded-devel@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-09-14 1:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [meta-networking][PATCH v2] " mingli.yu
2018-09-13 11:07 ` Alexander Kanavin
2018-09-13 11:09 ` Alexander Kanavin
2018-09-14 1:14 ` Yu, Mingli
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.