From e48f32c77a8c503b17689e390075f5ee3e9a8476 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 17 Jun 2023 14:26:30 -0400 Subject: sbopkglint: spaces in filenames WIP #11. --- sbopkglint.d/05-basic-sanity.t.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh index 22dc309..d62238a 100644 --- a/sbopkglint.d/05-basic-sanity.t.sh +++ b/sbopkglint.d/05-basic-sanity.t.sh @@ -169,16 +169,20 @@ done # 20220414 bkw: absolute symlinks used to be an error, but there are just # too many packages that use them. so only flag them if they're broken links. -abslinks="$( find . -type l -lname '/*' )" -[ -n "$abslinks" ] && for i in $abslinks; do - target="$( readlink $i | sed 's,^/*,,' )" - [ -e "$target" ] || brokenabslinks+="$i " +find . -type l -lname '/*' | while read f; do + target="$( readlink "$f" | sed 's,^/*,,' )" + [ -e "$target" ] || ls -bld "$f" > .badlinks.$$ done -brokenlinks="$( find -L . -type l \! -lname '/*' )" +if [ -s .badlinks.$$ ]; then + warn "package contains broken absolute symlinks:" + cat .badlinks.$$ +fi + +rm -f .badlinks.$$ -[ -n "$brokenabslinks" ] && warn "package contains broken absolute symlinks:" && ls -ld $brokenabslinks -[ -n "$brokenlinks" ] && warn "package contains broken relative symlinks:" && ls -ld $brokenlinks +find_warnfiles "package contains broken relative symlinks:" \ + -L . -type l \! -lname '/*' # 20230320 bkw: empty directories. this isn't an error, just a note, and # we ignore any empty dirs under /var because lots of packages need these. -- cgit v1.2.3