source: branches/3.2/MondoRescue/bin/mr-process-ldd @ 3230

Last change on this file since 3230 was 3230, checked in by bruno, 6 years ago
  • the mr-* scripts now behave the same way as expeted in mindi (just return the values. More pretty printing is available with -v)
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/usr/bin/perl -w
2#
3# $Id$
4# Copyright B. Cornec 2005-2014
5# Provided under the GPL v2
6#
7# Get all depedencies from a binary (dynamic libraires reported by ldd and all their links)
8#
9use strict;
10use MondoRescue::File;
11
12=pod
13
14=head1 NAME
15
16mindi-process-ldd keeps track of the dependencies of a binary with its dynamic libraries
17
18=head1 DESCRIPTION
19
20mindi-process-ldd keeps track of the dependencies of a binary with its dynamic libraries by alalyzing the return of ldd on that binary and recursing on all the dependencies to provide the complete list of files needed to have this binary run in a mindi context
21
22=head1 SYNOPSIS
23
24mindi-process-ldd /path/to/binary ...
25
26=head1 ARGUMENTS
27
28=over 4
29
30=item B</path/to/binary>
31
32This is the path of the binary to analyze and for which we want its perl dependencies to be included
33
34=back
35
36=head1 WEB SITES
37
38The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
39
40=head1 USER MAILING LIST
41
42For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
43
44=head1 AUTHORS
45
46The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
47
48=head1 COPYRIGHT
49
50MondoRescue is distributed under the GPL v2.0 license or later,
51described in the file C<COPYING> included with the distribution.
52
53=cut
54
55
56my $file = mr_file_process_ldd(@ARGV) if (defined $ARGV[0]);
57
58my $verbose = undef;
59$verbose = 1 if ($ARGV[0] eq "-v");
60
61foreach my $f (sort keys %$file) {
62    print "$f\n" if (defined $verbose);
63    print "--\n" if (defined $verbose);
64    foreach my $l (@{$file->{$f}}) {
65        print "$l\n";
66    }
67    print "--\n" if (defined $verbose);
68}
Note: See TracBrowser for help on using the repository browser.