--- Mk/Scripts/qa.sh (revision 446947) +++ Mk/Scripts/qa.sh (working copy) @@ -822,10 +826,54 @@ return $rc } +sslmix() { + local file dep_file base_libs port_libs rc + rc=0 + + # Check all dynamicaly linked ELF files + # Some .so are not executable, but we want to check them too. + while read file; do + # No results presents a blank line from heredoc. + [ -z "${file}" ] && continue + + base_libs="" + port_libs="" + + while read dep_file; do + # No results presents a blank line from heredoc. + [ -z "${dep_file}" ] && continue + + if echo ${dep_file} | grep -qE "^(/usr/lib/libssl|/lib/libcrypto)\.so" > /dev/null; then + base_libs="${base_libs} ${dep_file}" + fi + if echo ${dep_file} | grep -qE "^(${PREFIX}|${LOCALBASE})/lib/lib(ssl|crypto)\.so" > /dev/null; then + port_libs="${port_libs} ${dep_file}" + fi + done <<-EOT + $(LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib ldd "${STAGEDIR}${file}" | \ + grep '=>' | \ + awk '{print $3}') + EOT + + if [ -n "${base_libs}" -a -n "${port_libs}" ]; then + err "${file} is linked to both base and port SSL libraries: `echo ${base_libs}` and `echo ${port_libs}`" + rc=1 + fi + done <<-EOT + $(list_stagedir_elfs | \ + file -F $'\1' -f - | \ + grep -a 'ELF.*FreeBSD.*dynamically linked' | \ + cut -f 1 -d $'\1'| \ + sed -e 's/^\.//') + EOT + + return ${rc} +} + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" -checks="$checks proxydeps sonames perlcore no_arch" +checks="$checks proxydeps sonames perlcore no_arch sslmix" ret=0 cd ${STAGEDIR}