• [gentoo-dev] [PATCH 1/3] linux-mod.eclass: use consistent style

    From Sam James@21:1/5 to All on Sun Dec 25 20:20:01 2022
    - Use Bash tests (i.e. [[ ]] instead of [ ])
    - Use consistent newlines for if/while
    - Drop unnecessary ; line terminators
    - Add a handful of missing || dies

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/linux-mod.eclass | 149 +++++++++++++++++-----------------------
    1 file changed, 64 insertions(+), 85 deletions(-)

    diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
    index ff2294f1e4ef..b0a1264288a0 100644
    --- a/eclass/linux-mod.eclass
    +++ b/eclass/linux-mod.eclass
    @@ -199,13 +199,13 @@ DEPEND="${RDEPEND}
    use_m() {
    debug-print-function ${FUNCNAME} $*

    - # if we haven't determined the version yet, we need too.
    - get_version;
    + # If we haven't determined the version yet, we need to.
    + get_version

    - # if the kernel version is greater than 2.6.6 then we should use
    + # If the kernel version is greater than 2.6.6 then we should use
    # M= instead of SUBDIRS=
    - [ ${KV_MAJOR} -ge 3 ] && return 0
    - [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \
    + [[ ${KV_MAJOR} -ge 3 ]] && return 0
    + [[ ${KV_MAJOR} -eq 2 && ${KV_MINOR} -gt 5 && ${KV_PATCH} -gt 5 ]] && \
    return 0 || return 1
    }

    @@ -216,10 +216,10 @@ use_m() {
    convert_to_m() {
    debug-p
  • From Ulrich Mueller@21:1/5 to All on Sun Dec 25 23:30:02 2022
    On Sun, 25 Dec 2022, Sam James wrote:

    + [[ ${KV_MAJOR} -eq 2 && ${KV_MINOR} -gt 5 && ${KV_PATCH} -gt 5 ]] && \
    return 0 || return 1

    Ouch. :)

    The "&& return 0 || return 1" can be omitted.

    }

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmOozHUPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4umDgH/jh1yBfJdbRQWz9YrvRxREMd5/Ys6RxXh+1C gq60B5DOfCYRv1oYdYLKbERgmYlk+CqX5fvJunWRkZi/L9gYOrSygtNODBaFFqAc hXpPjpFGRDNF3ARJ0ZKSU/tvq/0X7GjpwYbysOQ/F3XpEcyA2cX0V9K9Sxuhh7cd mlD9grUbERRknZQtDxnouHtcc4rRHXCp9+wO/7zc0t9gOeD8fE7aSD4eMRx/MTUo ebdrfkfhmLYB4Tq6Ez3/JN7nAkCW6pToz/DWcbaJUSdZZJLUhz45/zUNQXs9h3Nv QE6gPDGpgx6FT6oVpFVRoGzlIX1J03uiFiwlLOleub/Q7YAHc6o=
    =pmhN
    -----END PGP SIGNATURE-----

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