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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9F2B815808B for ; Sun, 13 Mar 2022 20:53:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C4D1CE08BF; Sun, 13 Mar 2022 20:53:20 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 96F33E08BF for ; Sun, 13 Mar 2022 20:53:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 97D18342AC3 for ; Sun, 13 Mar 2022 20:53:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0FDEFD0 for ; Sun, 13 Mar 2022 20:53:18 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1647204758.c193364d2e02c2615b207fd6919e15541c2ac8b4.sam@gentoo> Subject: [gentoo-commits] proj/qa-scripts:master commit in: / X-VCS-Repository: proj/qa-scripts X-VCS-Files: check_eclasses_eapis.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c193364d2e02c2615b207fd6919e15541c2ac8b4 X-VCS-Branch: master Date: Sun, 13 Mar 2022 20:53:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 80cab618-9d9a-4da6-b474-b89b28b3514e X-Archives-Hash: 517822a4597237796fbc180b256c7a61 commit: c193364d2e02c2615b207fd6919e15541c2ac8b4 Author: Sam James gentoo org> AuthorDate: Sun Mar 13 20:52:38 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sun Mar 13 20:52:38 2022 +0000 URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=c193364d check_eclasses_eapis.sh: needs gawk, not any awk Signed-off-by: Sam James gentoo.org> check_eclasses_eapis.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/check_eclasses_eapis.sh b/check_eclasses_eapis.sh index 76c332b..3a0fc07 100755 --- a/check_eclasses_eapis.sh +++ b/check_eclasses_eapis.sh @@ -10,6 +10,7 @@ else fi #[[ $(type pquery 2> /dev/null) ]] || exit 1 +[[ $(type gawk 2> /dev/null) ]] || exit 1 TMPEAPIS="/tmp/$(basename $0).global.$$.tmp" TMPECLASS="/tmp/$(basename $0).eclass.$$.tmp" @@ -19,7 +20,7 @@ ECLASSES=$(echo *.eclass) popd > /dev/null #pquery --attr eapi --attr inherited --raw --all --repo portdir > "${TMPEAPIS}" -find "${REPO_PATH}/metadata/md5-cache" -type f -name '*-[0-9]*' -exec awk -F= ' +find "${REPO_PATH}/metadata/md5-cache" -type f -name '*-[0-9]*' -exec gawk -F= ' BEGINFILE { n = split(FILENAME, f, "/") file = f[n-1] "/" f[n] @@ -38,7 +39,7 @@ find "${REPO_PATH}/metadata/md5-cache" -type f -name '*-[0-9]*' -exec awk -F= ' } ' '{}' \+ > "${TMPEAPIS}" -KNOWN_EAPIS=$(awk ' +KNOWN_EAPIS=$(gawk ' { e = gensub(/eapi="(.*)"/, "\\1", "", $2); eapi[e] = e } END { PROCINFO["sorted_in"]="@ind_num_asc"; for (e in eapi) print e } ' "${TMPEAPIS}") @@ -49,11 +50,11 @@ for x in ${ECLASSES}; do echo "Processing eclass \"${x}\"" rm -rf "${x}" mkdir "${x}" - awk -F'=' '$3 ~ /[ "]'"${x%.eclass}"'[ "]/ {print $1" "$2}' "${TMPEAPIS}" > "${TMPECLASS}" + gawk -F'=' '$3 ~ /[ "]'"${x%.eclass}"'[ "]/ {print $1" "$2}' "${TMPEAPIS}" > "${TMPECLASS}" pushd "${x}" > /dev/null echo "Overall statistics for eclass \"${x}\":" > "STATS.txt" for y in ${KNOWN_EAPIS}; do - awk -F ' ' '$3 ~ /"'"${y}"'"/ {print $1}' "${TMPECLASS}" > "${y}.txt" + gawk -F ' ' '$3 ~ /"'"${y}"'"/ {print $1}' "${TMPECLASS}" > "${y}.txt" tmpval=$(wc -l "${y}.txt" |cut -d' ' -f1) echo "EAPI=${y} count: ${tmpval}" >> "STATS.txt" done