Well, dep.pl is a program that checks the dependencies of a set of files, then it produces some sort of output. This output can be a full-detailed report with status messages, a brief report, even without status messages, or only the filenames of the shared objects.
The program depends on ldd, so if ldd can't check the dependency of a file, dep.pl will be unable too.
The usage is very simple after you understood the programs basic behaviour. The best way to do this is to read through the source, or experiment with it.
dep.pl [options] files...
--bare, -b
When printing the filenames of the required shared objects, dep.pl separates them with a newline. This options makes a single whitespace the new separator instead.
--chroot=[path], -C=[path]
Simulates a chroot into [path]. So if a file appears to be outside, the program will prepend [path] before the filename, forcing it to be inside.
--check-area=[path], -c=[path]
Skip all files that are outside [path]. This will skip those symbolic links that are inside [path], but their destination isn't.
--err, -e
Print all messages to STDERR, instead of STDOUT. Except of course, the filenames of the required shared objects. This option is mainly used to pass the results to another program, but still be able to see the progress.
--exclude=[list], -x=[list]
Colon separated list of files to exclude from the checking list. If a filename in this list begins with "/", it will match a filename in the checking list, if that filename begins with the string in the exclude list. In all other cases, a file will be removed from the checking list if a string in the exclude list is contained within it.
--force=[ln], -f=[ln]
When specified, dep.pl will use the [ln] language, if the message file for it can be found.
--help, -h
Displays a summary of options, then quits.
--libs, -l
Turn full-detailed mode off. That means, display the filenames of the shared objects only at the end, not as soon as possible. It produces less output, and I think it looks nicer.
--license, -L
Prints out the text of the GNU General Public License
--nohup, -n
Ignore the HUP signal. For that case, when you want to run the program in background, and logout.
--recursive, -R
Turn recursive mode on. Without this option, when dep.pl encounters a directory, it simply skips it. If it is passed to it, the program will list its contents, and add it to its list.
--report, -r
This is the default mode. When specified, it does not matter if --quiet or --libs was specified too, they will be ignored. In this mode, dep.pl produces a full-detailed report, by printing the shared objects used by a file right after finished checking it.
--stat=[level], -s=[level]
Just for fanatics. This option is used to display some little statistics: number of files found, number of required shared objects, a top-list, and so on. You can specify the detail level by giving this option an optional [level] argument. The higher this number is, the detailed the statistics will be.
--status=[boolean], -S=[boolean]
Controls the display of status messages. Turning status messages off is a very bad idea, for it turns off the display of shared objects too. The only use of this option is to test the speed of the program. Or to have joy in the clean statistics, to make status messages unable to ruin the sight...
--quiet, -q
Quiet mode. Do not print any message, just the final conclusion: the filenames of the required shared objects.
--version, -v
Print out version information, then exit.
However nice it would be, dep.pl is not a stand-alone program, it depends on some
other. First of all: perl, because it is a perl script, and without an interpreter,
it is just as good as nothing. If you've got perl, you should edit the first line of
dep.pl to contain the path of your perl executable. On most systems /usr/local/bin/perl
or /usr/bin/perl will work. If they do not, the command which perl
should
give the correct path.
The second program dep.pl needs is ldd. Without it, you won't be able to use the program. It is not part of every system, but if its there, your copy of dep.pl will run smoothly.
A nice configuration utility is included in the package too. It can be used in plain text mode too, but it is nicer to have some dialogs displayed. For this, you'll need either the dialog package, or the whiptail package installed. And of course, bash to be able to execute the script.
To install the files using the Makefiles, you'll need make. And probably you should edit the target paths in the top-level Makefile to suit your needs.
Some installation scripts need bash too, so its a good choice to install it.
When dep.pl appeared, it only spoke english. Today you can customise and translate
everything the program says. The so called "message files" are there for this. By default
they are located in /etc/dep.pl, and are called messages.[language]. When you
specify --force=[language]
to the program, it will try to use the file named
/etc/dep.pl/messages.[language].
If you don't want to force the usage of a specific language every time you start dep.pl, you can edit the main language configuration file, located by default at /etc/dep.pl/language.conf.
For you out there who are not brave enough to experiment (just a joke, I'm kidding :), let me show you some examples of usage.
dep.pl /bin/bash /bin/ash /bin/*sh
This will check/bin/bash
,/bin/ash
and every file in/bin
that ends withsh
. Also because no option is specified, the program will operate in full-detailed mode.
dep.pl /bin/*sh /tmp
This will check all files in/bin
that end withsh
, operate in full-detailed mode, and skip/tmp
, because that is a directory, and recursive mode is turned off by default.
dep.pl /bin/*sh /tmp -R
Calling dep.pl this way will behave just like the second example,
except one thing: it will check all files in /tmp
too, because
recursion is turned on.
dep.pl /bin -lR
Using this syntax, the program will check all files in /bin
, but
using the basic report mode. That is, not printing the library filenames
right after checking a file.
dep.pl /bin -elR >/tmp/needed-files
The same as the fourth example, but it will print every status message to STDERR, only the library filenames will be printed to STDOUT, and that is redirected to a file for later processing.
dep.pl /bin -elR 2>/tmp/messages
The same as the fifth example, but it redirects STDERR to a file, so STDOUT can be passed directly to another program. This way, status messages can be stored for later processing.
dep.pl /bin -qR
Quiet mode. Hides all messages, only the library filenames are printed at the end, separated by a newline.
dep.pl /bin -bqR
Ahhh, quiet! Calling the program like this will cause to hide all status messages, error messages and everything. Only the filenames will be printed, without a newline after each.
dep.pl /bin -beqR
Exactly the same as the previous example.
dep.pl /bin -qrR
The same as dep.pl /bin -R
, because explicitly specifying -r
overrides all other options. That means, if you call dep.pl with an
extra -r, it won't matter if you specified any either -q or
-l, they will be ignored.
dep.pl /bin -S=off
Try it! -S is a tricky option. It is foolish to use it without -s, for it will turn off every status message, therefore only the banner will be printed.
dep.pl /bin -S=off -s
This will finally work. It will omit every status message, even the filenames of the libraries, but will produce a little statistics.
dep.pl /bin -s=1 -lR
My personal favourite. Turn full-detailed mode off, but display some status messages, and produce the currently available most detailed statistics.
dep.pl /home/virtual/host1 -lR
This will check all files within /home/virtual/host1, even those that are outside of it. This is possible if a symlink in /home/virtual/host1 points to a directory outside.
dep.pl /home/virtual/host1 -lR -x=/home/virtual/host1/proc
The same as the previous example, but skips all files in /home/virtual/host1/proc. This is very useful if one wants to debug an already set up, working virtual host, where the proc file-system is vital, therefore can't be unmounted.
dep.pl /home/virtual/host1 -lR -x=/home/virtual/host1/proc -c=/home/virtual/host1
Exactly the same as the example above, except that it will skip files that are outside /home/virtual/host1. You can redirect the output to a file for later analysis to find symlinks pointing outside the virtual root.
dep.pl /home/virtual/host1 -lRn -x=/home/virtual/host1/proc -c=/home/virtual/host1 &>output &
Does the same as the previous example, except that all output will be redirected to the file output, the program will run in the background, and we can logout, it won't disturb it.