Changeset View
Changeset View
Standalone View
Standalone View
Mk/Scripts/qa.sh
Show First 20 Lines • Show All 641 Lines • ▼ Show 20 Lines | proxydeps_suggest_uses() { | ||||
elif expr ${lib_file} : "${LOCALBASE}/lib/[^/]*$" > /dev/null; then | elif expr ${lib_file} : "${LOCALBASE}/lib/[^/]*$" > /dev/null; then | ||||
lib_file=${lib_file#${LOCALBASE}/lib/} | lib_file=${lib_file#${LOCALBASE}/lib/} | ||||
lib_file=${lib_file%.so*}.so | lib_file=${lib_file%.so*}.so | ||||
warn "you need LIB_DEPENDS+=${lib_file}:${pkg}" | warn "you need LIB_DEPENDS+=${lib_file}:${pkg}" | ||||
fi | fi | ||||
} | } | ||||
proxydeps() { | proxydeps() { | ||||
local file dep_file dep_file_pkg already rc | local file dep_file dep_file_pkg already rc dep_lib_file dep_lib_files | ||||
rc=0 | rc=0 | ||||
# Check all dynamicaly linked ELF files | # Check all dynamicaly linked ELF files | ||||
# Some .so are not executable, but we want to check them too. | # Some .so are not executable, but we want to check them too. | ||||
while read -r file; do | while read -r file; do | ||||
# No results presents a blank line from heredoc. | # No results presents a blank line from heredoc. | ||||
[ -z "${file}" ] && continue | [ -z "${file}" ] && continue | ||||
Show All 27 Lines | while read -r dep_file; do | ||||
proxydeps_suggest_uses ${dep_file_pkg} ${dep_file} | proxydeps_suggest_uses ${dep_file_pkg} ${dep_file} | ||||
rc=1 | rc=1 | ||||
fi | fi | ||||
else | else | ||||
err "${file} is linked to ${dep_file} that does not belong to any package" | err "${file} is linked to ${dep_file} that does not belong to any package" | ||||
rc=1 | rc=1 | ||||
fi | fi | ||||
already="${already} ${dep_file}" | already="${already} ${dep_file}" | ||||
dep_lib_file=$(basename ${dep_file}) | |||||
dep_lib_files="${dep_lib_files} ${dep_lib_file%%.so*}.so" | |||||
done <<-EOT | done <<-EOT | ||||
$(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \ | $(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \ | ||||
awk ' | awk ' | ||||
BEGIN {section=0} | BEGIN {section=0} | ||||
/^\// {section++} | /^\// {section++} | ||||
!/^\// && section<=1 && ($3 ~ "^'${PREFIX}'" || $3 ~ "^'${LOCALBASE}'") {print $3}') | !/^\// && section<=1 && ($3 ~ "^'${PREFIX}'" || $3 ~ "^'${LOCALBASE}'") {print $3}') | ||||
EOT | EOT | ||||
done <<-EOT | done <<-EOT | ||||
$(list_stagedir_elfs | \ | $(list_stagedir_elfs | \ | ||||
file -F $'\1' -f - | \ | file -F $'\1' -f - | \ | ||||
grep -a 'ELF.*FreeBSD.*dynamically linked' | \ | grep -a 'ELF.*FreeBSD.*dynamically linked' | \ | ||||
cut -f 1 -d $'\1'| \ | cut -f 1 -d $'\1'| \ | ||||
sed -e 's/^\.//') | sed -e 's/^\.//') | ||||
EOT | EOT | ||||
# Check whether all files in LIB_DPEENDS are actually linked against | |||||
for _library in ${WANTED_LIBRARIES} ; do | |||||
if ! listcontains ${_library} "${dep_lib_files}" ; then | |||||
warn "you might not need LIB_DEPENDS on ${_library}" | |||||
fi | |||||
done | |||||
[ -z "${PROXYDEPS_FATAL}" ] && return 0 | [ -z "${PROXYDEPS_FATAL}" ] && return 0 | ||||
return ${rc} | return ${rc} | ||||
} | } | ||||
sonames() { | sonames() { | ||||
[ ! -d ${STAGEDIR}${PREFIX}/lib -o -n "${BUNDLE_LIBS}" ] && return 0 | [ ! -d ${STAGEDIR}${PREFIX}/lib -o -n "${BUNDLE_LIBS}" ] && return 0 | ||||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |