Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2c8d9a18a5
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (40 sloc) 1.822 kb
#!/bin/bash
#############################################################
# #
# check-ldd.plugin - plugin that performs ldd checking #
# #
#############################################################
# #
# Copyright 2005 by Auke Kok under GPLv2 #
# #
#############################################################
plugin_module_check_ldd() {
local MODULE VERSION I_LOG LDD_STATUS IFS_OLD IFS NEW_LD LOG FILE
if [ "$LDD_CHECK" == "off" ]; then
return 2
fi
debug_msg "plugin_module_check_ldd ($@)"
MODULE=$1
VERSION=$(installed_version $MODULE)
I_LOG=$INSTALL_LOGS/$MODULE-$VERSION
LDD_STATUS=2
if [ -e "$I_LOG" ]; then
IFS_OLD="$IFS"
export IFS=$'\n'
# fast-construct per-module LD path including all /lib/ like directories
NEW_LD=$(cat "$I_LOG" | grep "/lib/" | files | sed 's/\(.*\)\/\([^\/]*\)$/\1/g' | uniq | tr '\n' ':')
LOG=$(cat "$I_LOG" | grep "/bin/\|/games/\|/lib/\|/sbin/\|/libexec/" | grep -v "/doc/\|/fonts/\|/include/\|/locale/\|/man/\|/modules/\|/var/")
for FILE in $LOG; do
if [ -f "$FILE" ] && [ ! -h "$FILE" ] && file -b "$FILE" | grep -q "ELF" && LD_LIBRARY_PATH=$NEW_LD ldd "$FILE" 2>&1 | grep -q "not found" ; then
(
export IFS="$IFS_OLD"
message "${FILE_COLOR}${FILE}${DEFAULT_COLOR} of ${MODULE_COLOR}${MODULE} ${PROBLEM_COLOR}is broken. ${DEFAULT_COLOR}"
LD_LIBRARY_PATH=$NEW_LD ldd "$FILE" 2>&1 | grep "not found"
)
LDD_STATUS=1
fi
done
fi
return $LDD_STATUS
}
plugin_register MODULE_CHECK plugin_module_check_ldd
Jump to Line
Something went wrong with that request. Please try again.