From 99e00af9ccc9808f73500ba05dcfa22664d34d62 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Thu, 15 Oct 2026 13:57:30 +0100 Subject: [PATCH] Add check-dependencies. --- check-dependencies | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 check-dependencies diff --git a/check-dependencies b/check-dependencies new file mode 100755 index 0000000..068a934 --- /dev/null +++ b/check-dependencies @@ -0,0 +1,23 @@ +#!/bin/bash +# Version: 0.0.3 +# Copyright (c) 2007 - 2026: +# Darren 'Tadgy' Austin +# Licensed under the terms of the GNU General Public License version 3. +# +# This is a quick^Wslow dirty hack to check binaries and libraries for missing +# dependancies using ldd. Only those files with missing dependancies (along +# with the missing library information itself) will be written to stderr. +# Redirecting stderr to a file is advised, since this can produce a large +# volume of output on a system with many missing libraries. + +echo "This will take a little while..." + +{ find -P "${1:-/}" -regextype posix-extended \ + \( -regex "^/(boot|data|dev|etc|home|lost\+found|media|mnt|proc|root|run|srv|sys|tmp|var)" -a -prune \) -o \ + \( -regex "^/lib(64)?/ld-.*" -a -prune \) -o \ + \( -regex "^/lib/(dhcpcd|firmware|modprobe\.d|modules)" -a -prune \) -o \ + \( -regex "^/(opt|usr|usr/local)/(doc|etc|include|info|man|share|src)" -a -prune \) -o \ + \( -regex "^/usr/lib(64)?/(firefox|java|jdk|jre|seamonkey|thunderbird)-.*" -a -prune \) -o \ + \( -regex "^/usr/lib(64)?/(locale|qt/plugins/.*.debug)" -a -prune \) -o \ + -type f -print0 | xargs -0 -r file -N -0 | grep -E -a ".*ELF.*(executable|shared object).*dynamically" | cut -d $'\0' -f1 | sort | \ + xargs -r ldd 2>/dev/null | grep -E "(^/|not found)" | grep -E -B 1 "^[[:space:]]" | grep -E -v "^--"; } >&2