From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: bin/
Date: Sat, 9 Jul 2022 19:50:43 +0000 (UTC) [thread overview]
Message-ID: <1657394988.b22f6af5e32950859390dc2efd0379c572258bda.dolsen@gentoo> (raw)
commit: b22f6af5e32950859390dc2efd0379c572258bda
Author: Hadrien Lacour <hadrien.lacour <AT> posteo <DOT> net>
AuthorDate: Sat Mar 31 20:39:01 2018 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> 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 <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoolkit/pull/6
Signed-off-by: Brian Dolbec <dolsen <AT> 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
}
next reply other threads:[~2022-07-09 19:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 19:50 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-24 18:05 [gentoo-commits] proj/gentoolkit:master commit in: bin/ Matt Turner
2024-06-24 18:05 Matt Turner
2024-06-24 18:05 Matt Turner
2024-05-25 3:45 Matt Turner
2024-05-25 3:45 Matt Turner
2024-05-25 3:45 Matt Turner
2023-08-29 15:48 Mike Gilbert
2023-08-29 1:38 Sam James
2023-08-29 0:51 Sam James
2022-12-03 13:54 Michał Górny
2022-12-03 13:54 Michał Górny
2022-07-28 15:29 Brian Dolbec
2022-05-19 4:30 Sam James
2021-03-12 2:31 Matt Turner
2021-02-25 0:06 Matt Turner
2020-12-31 22:11 Matt Turner
2020-03-16 14:24 Ben Kohler
2016-10-17 17:39 Paul Varner
2016-06-06 21:15 Paul Varner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1657394988.b22f6af5e32950859390dc2efd0379c572258bda.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox