From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 142951396D0 for ; Wed, 6 Sep 2017 23:41:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 729CBE0C7C; Wed, 6 Sep 2017 23:40:54 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 153A1E0C5F for ; Wed, 6 Sep 2017 23:40:53 +0000 (UTC) Received: from [192.168.1.5] (pool-71-127-246-67.nwrknj.fios.verizon.net [71.127.246.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mpagano) by smtp.gentoo.org (Postfix) with ESMTPSA id E2E2E33BF1C for ; Wed, 6 Sep 2017 23:40:52 +0000 (UTC) From: Mike Pagano Subject: [gentoo-dev] [PATCH v3] eclass/kernel-2.eclass: Remove use of tr in global scope To: gentoo-dev@lists.gentoo.org Message-ID: Date: Wed, 6 Sep 2017 19:40:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fXmO0GUISxDXnP6L7UmRsHEHDoBIgh7Iq" X-Archives-Salt: d8af2d61-5160-4951-96ba-8d69dd0f2598 X-Archives-Hash: c4aa3c492d1988b5ec8aafdad36a3e36 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fXmO0GUISxDXnP6L7UmRsHEHDoBIgh7Iq Content-Type: multipart/mixed; boundary="rfTtvQeKiLJ3jTuITMUm3fkF8xjmTJ8Je"; protected-headers="v1" From: Mike Pagano To: gentoo-dev@lists.gentoo.org Message-ID: Subject: [gentoo-dev] [PATCH v3] eclass/kernel-2.eclass: Remove use of tr in global scope --rfTtvQeKiLJ3jTuITMUm3fkF8xjmTJ8Je Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable This time, use bash 4.0, but limit the use of this function to ebuild tha= t have EAPI >=3D 6. Display a warning for maintainers to upgrade their ebuilds, or remove the= call. Thanks to mgorny for the suggestion. Signed-off-by: Mike Pagano --- eclass/kernel-2.eclass | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 84909f30c..a80f3e91a 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1407,11 +1407,20 @@ getfilevar() { # This function sets ARCH_URI and ARCH_PATCH # with the neccessary info for the arch sepecific compatibility # patchsets. +# To use, an ebuild could contain a line like: +# AMD64_URI=3Dhttp//linktothearchspecificpatch +# This function requires EAPI >=3D 6. =20 detect_arch() { =20 - local ALL_ARCH LOOP_ARCH LOOP_ARCH_L COMPAT_URI i TC_ARCH_KERNEL + if [[ "${EAPI}" -lt 6 ]]; then=20 + eqawarn "ebuild is attempting to call detect_arch when EAPI < 6."=20 + eqawarn "This function will not be executed."=20 + return + fi =20 + local ALL_ARCH LOOP_ARCH LOOP_ARCH_L COMPAT_URI i TC_ARCH_KERNEL +=09 # COMPAT_URI is the contents of ${ARCH}_URI # ARCH_URI is the URI for all the ${ARCH}_URI patches # ARCH_PATCH is ARCH_URI broken into files for UNIPATCH @@ -1425,18 +1434,15 @@ detect_arch() { COMPAT_URI=3D"${LOOP_ARCH}_URI" COMPAT_URI=3D"${!COMPAT_URI}" =20 - declare -l LOOP_ARCH_L=3D${LOOP_ARCH} - [[ -n ${COMPAT_URI} ]] && \ - ARCH_URI=3D"${ARCH_URI} ${LOOP_ARCH_L}? ( ${COMPAT_URI} )" + ARCH_URI=3D"${ARCH_URI} ${LOOP_ARCH,,}? ( ${COMPAT_URI} )" =20 - declare -u TC_ARCH_KERNEL=3D$(tc-arch-kernel) - if [[ ${LOOP_ARCH} =3D=3D ${TC_ARCH_KERNEL} ]]; then + TC_ARCH_KERNEL=3D$(tc-arch-kernel); + if [[ ${LOOP_ARCH} =3D=3D ${TC_ARCH_KERNEL^^} ]]; then for i in ${COMPAT_URI}; do ARCH_PATCH=3D"${ARCH_PATCH} ${DISTDIR}/${i/*\//}" done fi - done } =20 --=20 2.13.5 --rfTtvQeKiLJ3jTuITMUm3fkF8xjmTJ8Je-- --fXmO0GUISxDXnP6L7UmRsHEHDoBIgh7Iq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEBGFuxmO2fsZ/M0XX+h2KeGDML5YFAlmwh4IACgkQ+h2KeGDM L5baLBAAlJCwxyXaS3s7YXtOTnY8nUV0vgOjcwh/LX8PydaDKwskHz6STCVB/Bhc U+prZNhkjjKZiYKtlHG+iPCxoVhr5TvhdA7MIOb/CIzIfwNHEW0dzWbQggR+VkZe 6+48hf3mmUwgzDJmbiwcqDx55WLmx6A0NADyT4J4IovcxET4GwpC4xDw/7Bc/kpE X3TCpgBw3Ps+FvT+CfHUVsW1DGtD/65au+Ycva7FPtpAGM/Uj0YLXCzZhPsLkblk krbKWN876Q17XmO1pW57eBdbkdK07TPjSt9B6LpH2Ci+uDBZ8zXUsfcRt+4pRcAY qiXrKKqvBJ3GbjD9CN5YY5dPrQ9f5LrAqlrSVVFtQFBedhWy2mdyqHn5a9RdxnIE 3PBWNfCaXD83ov4vqaaOV3pVIu46rigktAj499f7qm6b264w5ZTrBVdzZ6fJe34w 5L9hz9FBaBALraEHUhp6M4tOeiMqgUDZsO8k7RuSpxaN4n5B6kMJltwpkatoQxjs h+Maeum3xg6GqLdiUR33FIsrZ6FSGcQhAElmtXKVOobho+XwiQKTKjbJZvAXh31S hzlnXiTiTqFs0VLuien70shxgm1izy4p6uPDy9noIBnxIfrm/+G+AFoenXcJTAFz lqQZlW6ldLyZefX+iQzMK78/6oOGi1+/VDJIwf8DBRL5C+gRMF4= =XX+U -----END PGP SIGNATURE----- --fXmO0GUISxDXnP6L7UmRsHEHDoBIgh7Iq--