This avoids collecting interpreters from firmware likes like QEMU
installs them for instance.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
local file="${1}"
local filelist="${2}"
+ # Don't find interpreters for non-executable files
+ if [ ! -x "${file}" ]; then
+ return 0
+ fi
+
local interpreter="$(readelf -l "${file}" 2>/dev/null | \
grep "program interpreter" | tr -d "]" | awk '{ print $NF }')"
find_script_interpreter() {
local file="${1}"
+ # Don't find interpreters for non-executable files
+ if [ ! -x "${file}" ]; then
+ return 0
+ fi
+
local first_line="$(grep -q "^#!" "${file}" && head -n1 "${file}")"
# Skip files that are not scripts