From 92d24666baf06dfd2fc993c28a9eaf5fbb9e53fb Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 17 Jun 2023 02:12:38 -0400 Subject: sbopkglint: spaces in filenames WIP #6. --- sbopkglint.d/60-usr_info.t.sh | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/sbopkglint.d/60-usr_info.t.sh b/sbopkglint.d/60-usr_info.t.sh index a9b2494..fd1c976 100644 --- a/sbopkglint.d/60-usr_info.t.sh +++ b/sbopkglint.d/60-usr_info.t.sh @@ -54,18 +54,25 @@ check_info() { } if [ -d usr/info ]; then + find_warnfiles "/usr/info may not contain filenames with spaces:" \ + usr/info -name '* *' + for i in usr/info/*; do if [ "$i" != 'usr/info/*' ]; then - if [ -d "$i" ]; then - BADDIRS+="$i " - else - case "$i" in - usr/info/dir) dir_found=1 ; check_info "$i" 0 ;; - *.info*.gz) info_found=1 ; check_info "$i" 1 ;; - *.info*) info_found=1 ; check_info "$i" 0 ; NONGZIP+="$i " ;; - *) BADFILES+="$i " ;; - esac - fi + case "$i" in + *' '*) ;; # space in filename, already complained about + *) + if [ -d "$i" ]; then + BADDIRS+="$i " + else + case "$i" in + usr/info/dir) dir_found=1 ; check_info "$i" 0 ;; + *.info*.gz) info_found=1 ; check_info "$i" 1 ;; + *.info*) info_found=1 ; check_info "$i" 0 ; NONGZIP+="$i " ;; + *) BADFILES+="$i " ;; + esac + fi + esac fi done @@ -77,11 +84,11 @@ if [ -d usr/info ]; then ;; "01") warn "package has info files, but doinst.sh does not call install-info" ;; "10") warn "package has no info files, but /usr/info/dir is created by doinst.sh (huh?)" ;; - "00") warn "/usr/info exists, but contains no info files" ;; + "00") warn "/usr/info exists, but contains no valid info files" ;; esac [ -n "$BADDIRS" ] && warn "/usr/info may not contain subdirectories: " && ls -ld $BADDIRS - [ -n "$BADFILES" ] && warn "/usr/info contains bogus files: " && ls -ld $BADFILES - [ -n "$NONINFO" ] && warn "/usr/info contains bad info files: " && ls -ld $NONINFO + [ -n "$BADFILES" ] && warn "/usr/info contains non-info files: " && ls -ld $BADFILES + [ -n "$NONINFO" ] && warn "/usr/info contains invalid info files: " && ls -ld $NONINFO [ -n "$NONGZIP" ] && note "/usr/info contains non-gzipped info files: " && ls -ld $NONGZIP fi -- cgit v1.2.3