[poky] [PATCH 1/1] msmtp: add link sendmail for lsb command check

Richard Purdie richard.purdie at linuxfoundation.org
Fri Mar 18 02:56:27 PDT 2011


On Fri, 2011-03-18 at 17:00 +0800, Kang Kai wrote:
> From: Kang Kai <kai.kang at windriver.com>
> 
> LSB command check will test the exist of sendmail, so make sendmail
> link to msmtp in order to pass the test.
> 
> Related to [YOCTO #520]
> 
> Signed-off-by: Kang Kai <kai.kang at windriver.com>
> ---
>   meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   10 +++++++++-
>   1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/recipes-extended/msmtp/msmtp_1.4.23.bb 
> b/meta/recipes-extended/msmtp/msmtp_1.4.23.bb
> index cb3d83c..b3500d0 100644
> --- a/meta/recipes-extended/msmtp/msmtp_1.4.23.bb
> +++ b/meta/recipes-extended/msmtp/msmtp_1.4.23.bb
> @@ -6,7 +6,7 @@ SECTION = "console/network"
>   PRIORITY = "required"
>   LICENSE = "GPLv3"
>   DEPENDS = "zlib gnutls"
> -PR = "r0"
> +PR = "r1"
> 
> 
>   #COPYING or Licence
> @@ -19,3 +19,11 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
>   SRC_URI[sha256sum] = 
> "269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"
> 
>   inherit gettext autotools
> +
> +pkg_postinst_${PN} () {
> +    update-alternatives --install ${sbindir}/sendmail sendmail 
> ${bindir}/msmtp 100
> +}
> +
> +pkg_prerm_${PN} () {
> +    update-alternatives --remove sendmail ${bindir}/msmtp
> +}

Instead of doing this directly could you use the update-alternatives
class please? meta/recipes-connectivity/iproute2/iproute2.inc shows an
example of this. I think it should be something like:

inherit update-alternatives

ALTERNATIVE_NAME = "sendmail"
ALTERNATIVE_PATH = "${sbindir}/mstmp"
ALTERNATIVE_LINK = "${sbindir}/sendmail"
ALTERNATIVE_PRIORITY = "100"

Thanks,

Richard






More information about the poky mailing list