aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-04-12 14:07:22 -0400
committerB. Watson <yalhcru@gmail.com>2022-04-12 14:07:22 -0400
commitdd8c15a01b40e864fd06ebf9c8afce40188c7aad (patch)
tree9e1e6f2af342294992893d366ad406787b98f91d
parent9d489f9f9d26de46b4a932219d2171ca696c8993 (diff)
downloadsbo-maintainer-tools-dd8c15a01b40e864fd06ebf9c8afce40188c7aad.tar.gz
fix absolute and broken link detection
-rw-r--r--sbopkglint.d/05-basic-sanity.t.sh11
1 files changed, 2 insertions, 9 deletions
diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh
index 1a03004..612b107 100644
--- a/sbopkglint.d/05-basic-sanity.t.sh
+++ b/sbopkglint.d/05-basic-sanity.t.sh
@@ -151,15 +151,8 @@ for i in $badfiles; do
[ -e "$i" ] && warn "forbidden file: $i"
done
-badlinks="$( find -L . -type l )"
-[ -n "$badlinks" ] && for i in $badlinks; do
- target="$( readlink "$i" )"
- case "$target" in
- /*) abslinks+="$i " ;;
- *) brokenlinks+="$i " ;;
- esac
-done
+abslinks="$( find . -type l -lname '/*' )"
+brokenlinks="$( find -L . -type l \! -lname '/*' )"
[ -n "$abslinks" ] && warn "package contains absolute symlinks (should be relative):" && ls -ld $abslinks
[ -n "$brokenlinks" ] && warn "package contains broken symlinks:" && ls -ld $brokenlinks
-