Hopefully this will make less typos than manual edits and save some time.
optionalDir="/etc/sysconfig/tcedir/optional"
result=$(find . -exec ldd {} \; 2>/dev/null | awk '/\/usr\/local\/lib/ {print $3}' | xargs ls -lah | awk '{print $11}' | awk -F'/' '{print $4 ".tcz"}' | sort | uniq)
while [ "$result" != "$resultCopy" ]; do
resultCopy=$result
for item in $result; do
list_file="${optionalDir}/${item}.dep"
if [ -e "$list_file" ]; then
while read -r line; do
if [ -n "$line" ]; then
result=$(echo "$result" | tr ' ' '\n' | grep -v "$line")
fi
done < "$list_file"
fi
done
done
echo $result | tr ' ' '\n'
It is expected to run this script in the directory containing binaries that already have all dependencies loaded.
It also won't work with copy2fs extensions.
Edit: "-type f" removed from second line