source: branches/3.2/MondoRescue/bin/mr-read-all-link @ 3230

Last change on this file since 3230 was 3230, checked in by bruno, 5 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 links from a file
8#
9use strict;
10use Data::Dumper;
11use MondoRescue::File;
12
13=pod
14
15=head1 NAME
16
17mr-read-all-link keeps track of all the links of a file and display them
18
19=head1 DESCRIPTION
20
21mr-read-all-link keeps track of all the links of a file and display them, by analyzing the path under which the file is located and mentioning all links that are encountered so that all the required content for a chroot environment are given back correctly.
22
23=head1 SYNOPSIS
24
25mr-read-all-link /path/to/file ...
26
27=head1 ARGUMENTS
28
29=over 4
30
31=item B</path/to/file>
32
33This is the path of the binary file and for which we want its links to be included
34
35=back
36
37=head1 WEB SITES
38
39The 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/>.
40
41=head1 USER MAILING LIST
42
43For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
44
45=head1 AUTHORS
46
47The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
48
49=head1 COPYRIGHT
50
51MondoRescue is distributed under the GPL v2.0 license or later,
52described in the file C<COPYING> included with the distribution.
53
54=cut
55
56
57my $file = mr_file_read_all_link(@ARGV) if (defined $ARGV[0]);
58
59my $verbose = undef;
60$verbose = 1 if ($ARGV[0] eq "-v");
61
62#print Dumper($file);
63
64foreach my $f (sort keys %$file) {
65    print "$f\n" if (defined $verbose);
66    print "--\n" if (defined $verbose);
67    #print Dumper($f);
68    foreach my $l (@{$file->{$f}}) {
69        print "$l\n";
70    }
71    print "--\n" if (defined $verbose);
72}
Note: See TracBrowser for help on using the repository browser.