aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-06-15 05:23:19 -0400
committerB. Watson <urchlay@slackware.uk>2023-06-15 05:23:19 -0400
commitf7780841554001639e7df097ba0ee2ae45510197 (patch)
tree6dc48670784df9931f8c1429b6a0a9eab52522b3 /sbopkglint
parent9703fdec3ecff8ac6c50524db5c1039326667fe8 (diff)
downloadsbo-maintainer-tools-f7780841554001639e7df097ba0ee2ae45510197.tar.gz
sbopkglint: more colors, handle spaces in filenames (WIP).
Diffstat (limited to 'sbopkglint')
-rwxr-xr-xsbopkglint29
1 files changed, 27 insertions, 2 deletions
diff --git a/sbopkglint b/sbopkglint
index 6ab7241..3e50e4e 100755
--- a/sbopkglint
+++ b/sbopkglint
@@ -456,12 +456,12 @@ echo_FAILED() {
warn() {
[ "$warncount" = "0" ] && echo
: $(( warncount ++ ))
- echo "--- $@" 1>&2
+ echo -e "${RED}---${COLOR_OFF} $@" 1>&2
}
note() {
[ "$warncount" = "0" ] && echo
- echo "___ note: $@" 1>&2
+ echo -e "${GREEN}___ note:${COLOR_OFF} $@" 1>&2
}
die() {
@@ -469,6 +469,31 @@ die() {
exit 1
}
+find_warnfiles() {
+ local msg
+ local output=.files.$RANDOM
+ local note=0
+
+ if [ "$1" = "--note" ]; then
+ note=1
+ shift
+ fi
+
+ msg="$1"
+ shift
+
+ find "$@" -print0 | xargs -r0 ls -bld &> $output
+ if [ -s $output ]; then
+ if [ "$note" = "0" ]; then
+ warn "$msg"
+ else
+ note "$msg"
+ fi
+ cat $output 1>&2
+ fi
+ rm -f $output
+}
+
# N.B. these need to match the template (and they do)
TMP=${TMP:-/tmp/SBo}
OUTPUT=${OUTPUT:-/tmp}