From a154221eab368e21d219479e5e5a715dd14012be Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 17 Jun 2023 05:17:10 -0400 Subject: sbopkglint: spaces in filenames WIP #10. --- sbopkglint.d/20-arch.t.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sbopkglint.d/20-arch.t.sh b/sbopkglint.d/20-arch.t.sh index 6ad2d72..de13ad7 100644 --- a/sbopkglint.d/20-arch.t.sh +++ b/sbopkglint.d/20-arch.t.sh @@ -30,9 +30,6 @@ case "$ARCH" in *) warn "ARCH isn't noarch, i?86, x86_64, arm, or aarch64. don't know how to check binaries." ;; esac -INWRONGDIR="" -WRONGARCH="" -NOTSTRIPPED="" if [ -n "$WRONGDIR" ]; then find * -type f -print0 | \ xargs -0 file -m /etc/file/magic/elf | \ @@ -47,7 +44,7 @@ if [ -n "$WRONGDIR" ]; then # had to relax this check; it was too strict. $WRONGDIR/*/*|usr/$WRONGDIR/*/*) continue ;; $WRONGDIR/*|usr/$WRONGDIR/*) - INWRONGDIR+="$file " ;; + ls -lb "$file" >> .inwrongdir.$$ ;; esac # 64-bit packages can contain 2 types of 32-bit binaries: @@ -64,20 +61,22 @@ if [ -n "$WRONGDIR" ]; then # in 64-bit and 32-bit varieties, they must be in the correct # directory. if ! echo "$filetype" | grep -q -e "$CPU" -e 'no machine'; then - WRONGARCH+="$file " + ls -lb "$file" >> .wrongarch.$$ fi # don't check "no machine" ELF objects for being stripped. # our strip command doesn't know how to strip them! if ! echo "$filetype" | grep -q 'no machine'; then if echo "$filetype" | grep -q "not stripped"; then - NOTSTRIPPED+="$file " + ls -lb "$file" >> .notstripped.$$ fi fi done < .tmp.$$ rm -f .tmp.$$ fi -[ -n "$INWRONGDIR" ] && warn "shared lib(s) in wrong dir for ARCH:" && ls -l $INWRONGDIR -[ -n "$WRONGARCH" ] && warn "ELF object(s) with wrong arch (should be $CPU):" && ls -l $WRONGARCH -[ -n "$NOTSTRIPPED" ] && warn "ELF object(s) not stripped:" && ls -l $NOTSTRIPPED +[ -s .inwrongdir.$$ ] && warn "shared lib(s) in wrong dir for ARCH:" && cat .inwrongdir.$$ +[ -s .wrongarch.$$ ] && warn "ELF object(s) with wrong arch (should be $CPU):" && cat .wrongarch.$$ +[ -s .notstripped.$$ ] && warn "ELF object(s) not stripped:" && cat .notstripped.$$ + +rm -f .inwrongdir.$$ .wrongarch.$$ .notstripped.$$ -- cgit v1.2.3