Rudimentary dependency checker :)
Hi Guys ...
Feel free to comment/enhance. It's an ultra-primitive prototype ... :) Code:
#!/bin/bash Cheers, Tink |
Thanx, Tink.........
Just what I'm looking for to use in my Slackware PkgBuild setup I'm working on...........I've already got ideas to expand on this script for a system-wide dep check....... :) |
Okay, here's another little script for checking dependencies........
I decided not to use 'ldd' and used 'objdump' instead.........The reason for this is 'ldd' not only returns direct dependencies, but also returns dependencies of dependencies (quite a mouthful, eh), or "indirect" dependencies............The rationale behind this is you only need to worry about dependencies that are called directly by the executable (and not indirectly through one of it's dependencies)...........A proper search will turn up any missing files.........(plus I use 'objdump' for a bit of error-checking) Code:
#!/bin/sh find <path> -type d -exec finddep {} \; | grep 'MISSING' This will search out any missing dependencies............ I plan on expanding this to create a database of dependencies in /var/log/ for Slackware, one for each package installed, much like the "packages" and "scripts" directories in /var/log....... :) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- EDIT: Made changes in the find_dep() function to use 'ldd' instead of 'objdump' for searching dependencies......... |
Okay, stop the presses.....................It seems the 'whereis' command I use for finding the lib dependencies has a serious limitation................it does not know where all the lib directories are. like for KDE or X11 (apparently doesn't use the /etc/ld.so.cache database).......
So the 'whereis' command needs a little help.......or I'll need to use 'ldd' for searching locations for dependencies....... Anyway, my script needed more work...........so I revised the find_dep() function to use 'ldd' while still retaining 'objdump' for error-checking (it has a more informative error message which I can use)....... The changes are already made in the script above............... :) |
All times are GMT -5. The time now is 02:40 PM. |