From 8c4adf677a09e9de29b75d8a5e02f3687057423b Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Thu, 10 Sep 2020 15:42:46 -0700 Subject: [PATCH] drop powerpc- so that we now have enough column space to fit git revs Add the script and commands used for this analysis so that I'll remember it in the future... --- maxcol.awk | 20 ++++++++++++++++++++ snapaid.sh | 9 +++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 maxcol.awk diff --git a/maxcol.awk b/maxcol.awk new file mode 100755 index 0000000..51c8d3d --- /dev/null +++ b/maxcol.awk @@ -0,0 +1,20 @@ +#!/usr/bin/awk -f + +{ + if (NF > maxnf) + maxnf = NF + + for (i = 1; i <= NF; i++) { + l = length($i) + if (l > ar[i]) { + ar[i] = l + ex[i] = $i + } + } +} + +END { + for (i = 1; i <= NF; i++) { + printf("%2d %2d %s\n", i, ar[i], ex[i]) + } +} diff --git a/snapaid.sh b/snapaid.sh index 155f96d..ef5a319 100755 --- a/snapaid.sh +++ b/snapaid.sh @@ -326,12 +326,17 @@ elif [ x"$1" = x"find" ]; then cnt=$(wc -l < selection) awk ' BEGIN { - fmtstr = "%2s %-3s %-15s %-18s %-18s %-8s %-7s\n" - printf(fmtstr, "#", "TYP", "RELEASE", "ARCH", "PLATFORM/TYPE", "DATE", "SVNREV") + # xzcat snapshot.complete.idx.xz | ./maxcol.awk + # xzcat snapshot.complete.idx.xz | awk '{ print $3}' | sort -u + # note that for powerpc-* that first part is dropped + fmtstr = "%2s %-3s %-15s %-14s %-18s %-8s %-11s\n" + printf(fmtstr, "#", "TYP", "RELEASE", "ARCH", "PLATFORM/TYPE", "DATE", "REV") cnt = 1 } { + if ($3 ~ /^powerpc-/) + $3 = substr($3, 9) if ($4 == "xxx") plt=$7 else