Skip to content

Commit

Permalink
Fix detection of lib, lib32 and lib64 in check plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratler committed Feb 8, 2020
1 parent 3dae3db commit b51e310
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/check-find.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugin_module_check_find() {
IFS_OLD="$IFS"
export IFS=$'\n'

LOG=$(cat "$I_LOG" | grep "/bin/\|/games/\|/include/\|/lib/\|/sbin/" | grep -v "/doc/\|/etc/\|/fonts/\|/man/\|/var/")
LOG=$(egrep "/(bin|games|include|lib(32|64)?|sbin)/" $I_LOG | egrep -v "/(doc|etc|fonts|man|var)/")

for ITEM in $LOG ; do
if [ ! -e "$ITEM" ]; then
Expand Down
4 changes: 2 additions & 2 deletions plugins/check-ldd.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ plugin_module_check_ldd() {
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/\|/share/")
NEW_LD=$(egrep "/lib(32|64)?/" $I_LOG | files | sed 's/\(.*\)\/\([^\/]*\)$/\1/g' | sort -u | tr '\n' ':')
LOG=$(egrep "/(bin|games|lib(32|64)?|sbin|libexec)/" $I_LOG | egrep -v "/(doc|fonts|include|locale|man|modules|var|share|pkgconfig)/")

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
Expand Down
6 changes: 3 additions & 3 deletions plugins/check-md5sum.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ plugin_module_check_md5sum() {
if [ -e "$MD5_LOG" ]; then
export IFS=$'\t\n'

cat "$MD5_LOG" | grep "/bin/\|/games/\|/include/\|/lib/\|/sbin/" |
grep -v "/doc/\|/etc/\|/fonts/\|/man/\|/var/" |
while read LINE ; do
egrep "/(bin|games|include|lib(32|64)?|sbin)/" $MD5_LOG |
egrep -v "/(doc|etc|fonts|man|var)/" |
while read LINE ; do
if ! echo $LINE | md5sum --check --status ; then
FILE=$(echo $LINE | awk '{ print $2 }')
if [ -f "$FILE" ] && [ ! -h "$FILE" ] && file -b "$FILE" |
Expand Down

0 comments on commit b51e310

Please sign in to comment.