Article 4Z8FB An improvized script to check which SBo packages need to be rebuilt due to .so version changes.

An improvized script to check which SBo packages need to be rebuilt due to .so version changes.

by
Lockywolf
from LinuxQuestions.org on (#4Z8FB)
Hello, everyone.

I use -current and ponce's SBo repo. Since -current updates inevitably break .so versioning, I bodged a script to check which packages need to be rebuilt after an update.

Note that using ldd on untrusted binaries is a bad idea, but I doubt that untrusted binaries will end up in /bin/ or /usr/bin. You have been warned any way.

The latest version would be https://gitlab.com/Lockywolf/linuxbu..._slackdep.bash

But just in case, I am copying the source here for everyone's scrutiny.

Code:
#!/bin/bash
# 2019, lockywolf gmail.com
# ldd's /bin/, /sbin/, /usr/bin/, and /usr/sbin/,
# looking for "not found" and prints the relevant packages.

FILENAMES=$(find {/bin/,/sbin/,/usr/bin/,/usr/sbin/} -executable -type f | sort)
#FILENAMES=$(find /usr/bin/32 -executable -type f)

REPORT=""
PACKAGES=""

for fname in $FILENAMES
do
# printf "%s" "$fname"
# temp=$(ldd "$fname" 2>/dev/null | grep "not found")
temp=$(ldd "$fname" 2>/dev/null)
# printf "%s\n" "$fname"
missing_libs=$(printf "%s" "$temp" | grep "not found")
# printf "%s\n" "$missing_libs"
if [[ "$missing_libs" != "" ]]; then
printf "Found a broken binary: %s\n" "$fname"
printf "Libs=%s\n" "$missing_libs"
package=$(grep -lr "${fname:1}" "/var/log/packages")
printf "Package=%s\n" "$package"
REPORT="$REPORT"$(printf "Broken:%s\n%s\n%s\n\n" "$fname" "$missing_libs" "$package")
PACKAGES="$PACKAGES"$(printf "\n%s\n" "$package")
fi
done

# LIBS=$(printf "%s" "$LIBS" | uniq)
#printf "Packages before uniquing:\n"
#printf "%s\n" "$PACKAGES"
PACKAGES=$(printf "%s" "$PACKAGES" | sort |uniq)
#printf "%s" "$REPORT"
printf "%s" "Broken packages after:\n"
printf "%s" "$PACKAGES"
printf "\n"latest?d=yIl2AUoC8zA latest?i=dBg5BV6ljSo:HcIwCfCoS_8:F7zBnMy latest?i=dBg5BV6ljSo:HcIwCfCoS_8:V_sGLiP latest?d=qj6IDK7rITs latest?i=dBg5BV6ljSo:HcIwCfCoS_8:gIN9vFwdBg5BV6ljSo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments