From 8dfeeaccc2e5774f1c0650efbcf750bcc9eb1c8a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 28 Apr 2022 15:45:29 -0400 Subject: sbolint: fix tarball handling, relax SlackBuild perms check. sbopkglint: recommend noarch. --- sbopkglint.d/05-basic-sanity.t.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sbopkglint.d/05-basic-sanity.t.sh') diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh index 612b107..3b98c74 100644 --- a/sbopkglint.d/05-basic-sanity.t.sh +++ b/sbopkglint.d/05-basic-sanity.t.sh @@ -112,10 +112,11 @@ for i in $baddirs; do fi done +# 20220414 bkw: don't complain about broken symlinks here, they get checked elsewhere. for i in $fileonlydirs; do [ -d "$i" ] || continue dir_ok "$i" || warn_badperms "$i" - badstuff="$( find -L "$i" -mindepth 1 -maxdepth 1 \! -type f )" + badstuff="$( find -L "$i" -mindepth 1 -maxdepth 1 \! \( -type l -o -type f \) )" [ -n "$badstuff" ] && warn "$i should only contain files, not:" && ls -ld $badstuff done @@ -151,8 +152,15 @@ for i in $badfiles; do [ -e "$i" ] && warn "forbidden file: $i" 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 " +done + 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 +[ -n "$brokenabslinks" ] && warn "package contains broken absolute symlinks:" && ls -ld $brokenabslinks +[ -n "$brokenlinks" ] && warn "package contains broken relative symlinks:" && ls -ld $brokenlinks -- cgit v1.2.3