[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#253012: Bug#253498: [checks/scripts] check all /bin/sh scripts for bashisms



Hello,

Will this feature be implemented anytime soon?

Basically what I'm doing now on my archive wide checks is (bash script):

8<-------->8
searchDirs="/bin:/usr/bin:/sbin:/usr/sbin:/etc/init.d:/usr/share"
searchDirs="$(echo "$searchDirs" | sed "s/:/\n/g")"

# this part is executed under the extracted package's root dir
        for path in $searchDirs; do
                [ -d ".$path" ] || continue
                extra=
                echo "$path" | grep -v share > /dev/null || extra="-name '*.sh'"
                fList="$(find ".$path" $extra -type f -print)"
                for _file in $fList; do
                        if ! file "${_file}" | grep "shell script" >/dev/null; then
                                continue
                        fi

                        es=0
                        msg="$(checkbashisms "${_file}" 2>&1)" || es=$?

                        if [ $es = 1 ] && grep -v "does not appear to be a /bin/sh script;" <<< "$msg" > /dev/null; then
                                [ -z "$msg" ] || echo "$msg" >> "$file.report"
                        fi
                done
        done
8<-------->8

Kind regards,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



Reply to: