• [gentoo-dev] [PATCH] qmail.eclass: Patch make-makelib.sh only if it is

    From =?UTF-8?q?Petr=20Van=C4=9Bk?=@21:1/5 to All on Mon Apr 3 13:40:01 2023
    Some packages use qmail_set_cc function but they don't contain
    make-makelib.sh script. However, recent addition of || die to the sed
    patching this file is newly triggering build failure. This commit
    addresses the problem by checking if the script is available.

    Closes: https://bugs.gentoo.org/902009
    Closes: https://bugs.gentoo.org/902019
    Fixes: fd4e88c55e34 ("qmail.eclass: remove EAPI 6")
    Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
    Closes: https://github.com/gentoo/gentoo/pull/30456
    ---
    eclass/qmail.eclass | 7 ++++++-
    1 file changed, 6 insertions(+), 1 deletion(-)

    diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass
    index d527eb5f79d5..0e47aa55fa25 100644
    --- a/eclass/qmail.eclass
    +++ b/eclass/qmail.eclass
    @@ -92,7 +92,12 @@ qmail_set_cc() {

    echo "${cc} ${CFLAGS} ${CPPFLAGS}" > ./conf-cc || die 'Patching conf-cc failed.'
    echo "${ld} ${LDFLAGS}" > ./conf-ld || die 'Patching conf-ld failed.'
    - sed -e "s#'ar #'$(tc-getAR) #" -e "s#'ranlib #'$(tc-getRANLIB) #" -i make-makelib.sh || die
    +
    + # This function is used also by sys-apps/ucspi-tcp and sys-process/daemontools-encore
    + # but they don't have make-makelib.sh script, see bugs #902009 and #902019
    + if [[ -f make-makelib.sh ]]; then
    + sed -e "s#'ar #'$(tc-getAR) #" -e "s#'ranlib #'$(tc-getRANLIB) #" -i make-makelib.sh || die
    + fi
    }

    genqmail_src_unpack() {
    --
    2.39.2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)