diff options
author | B. Watson <urchlay@slackware.uk> | 2023-06-17 14:26:30 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-06-17 14:26:30 -0400 |
commit | e48f32c77a8c503b17689e390075f5ee3e9a8476 (patch) | |
tree | 78a869197dc468540521cd97748e74d943906fdf | |
parent | 09b16b1ec52fa28ce861419b5b7415724779a8f0 (diff) | |
download | sbo-maintainer-tools-e48f32c77a8c503b17689e390075f5ee3e9a8476.tar.gz |
sbopkglint: spaces in filenames WIP #11.
-rw-r--r-- | sbopkglint.d/05-basic-sanity.t.sh | 18 |
1 files 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. |