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 884C9158094 for ; Sat, 9 Jul 2022 19:50:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CE8F7E0972; Sat, 9 Jul 2022 19:50:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 B28E3E0972 for ; Sat, 9 Jul 2022 19:50:45 +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 B1099340C33 for ; Sat, 9 Jul 2022 19:50:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C9E2391 for ; Sat, 9 Jul 2022 19:50:43 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1657394988.b22f6af5e32950859390dc2efd0379c572258bda.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: bin/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: bin/revdep-rebuild.sh X-VCS-Directories: bin/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b22f6af5e32950859390dc2efd0379c572258bda X-VCS-Branch: master Date: Sat, 9 Jul 2022 19:50:43 +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: 218135bf-52b3-4898-a550-95b115f1f88e X-Archives-Hash: df78831a6655cebc3b45ad39464d8c48 commit: b22f6af5e32950859390dc2efd0379c572258bda Author: Hadrien Lacour posteo net> AuthorDate: Sat Mar 31 20:39:01 2018 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jul 9 19:29:48 2022 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=b22f6af5 revdep-rebuild.sh: use awk instead of gawk Bug: https://bugs.gentoo.org/652078 Signed-off-by: Zac Medico gentoo.org> Closes: https://github.com/gentoo/gentoolkit/pull/6 Signed-off-by: Brian Dolbec gentoo.org> bin/revdep-rebuild.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/bin/revdep-rebuild.sh b/bin/revdep-rebuild.sh index 633701e..5fecf97 100755 --- a/bin/revdep-rebuild.sh +++ b/bin/revdep-rebuild.sh @@ -235,9 +235,19 @@ countdown() { # Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u # (If any libs have whitespace in their filenames, someone needs punishment.) clean_var() { - gawk 'BEGIN {RS="[[:space:]]"} - /-\*/ {exit} - /[^[:space:]]/ {gsub(/\/\/+/, "/"); print}' | sort -u + awk ' + BEGIN {FS = "[[:space:]]"} + + { + for(i = 1; i <= NF; ++i) { + if($i ~ /-\*/) + exit + else if($i){ + gsub(/\/\/+/, "/", $i) + print $i + } + } + }' | sort -u } ## # Exit and optionally output to sterr @@ -805,8 +815,8 @@ main_checks() { # Look for symbol not defined errors if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" | grep -q -E 'symbol .* not defined'; then - message=$(gawk '/symbol .* not defined/ {NF--; print $0}' <<< "$ldd_output") - broken_lib=$(gawk '/symbol .* not defined/ {print $NF}' <<< "$ldd_output" | \ + message=$(awk '/symbol .* not defined/ {ORS = FS; for(i = 1; i < NF; ++i) print $i; printf "\n"}' <<< "$ldd_output") + broken_lib=$(awk '/symbol .* not defined/ {print $NF}' <<< "$ldd_output" | \ sed 's/[()]//g') echo "obj $broken_lib" >> "$BROKEN_FILE" echo_v " broken $broken_lib ($message)" @@ -820,7 +830,7 @@ main_checks() { *) if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" | grep -q -F 'undefined symbol:'; then - message=$(gawk '/undefined symbol:/ {print $3}' <<< "$ldd_output") + message=$(awk '/undefined symbol:/ {print $3}' <<< "$ldd_output") message="${message//$'\n'/ }" echo "obj $target_file" >> "$BROKEN_FILE" echo_v " broken $target_file (undefined symbols(s): $message)" @@ -835,7 +845,7 @@ main_checks() { la_broken="" la_lib="" for depend in $( - gawk -F"[=']" '/^dependency_libs/{ + awk -F"[=']" '/^dependency_libs/{ print $3 }' "$target_file" ); do @@ -876,7 +886,7 @@ main_checks() { done < <( # Regexify LD_LIBRARY_MASK. Exclude it from the search. LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}" - gawk -v ldmask="(${LD_LIBRARY_MASK//./\\\\.})" ' + awk -v ldmask="(${LD_LIBRARY_MASK//./\\\\.})" ' /no version information available/ && $0 !~ ldmask { gsub(/[()]/, "", $NF) if (seen[$NF]++) next @@ -1068,7 +1078,7 @@ show_unowned_files() { ewarn "The broken files are:" while read filename junk; do [[ $junk = *none* ]] && ewarn " $filename" - done < "$OWNERS_FILE" | gawk '!s[$0]++' # (omit dupes) + done < "$OWNERS_FILE" | awk '!s[$0]++' # (omit dupes) fi }